Fix bug #6035 - Possible race between fcntl F_SETLKW and alarm delivery.
authorJeremy Allison <jra@samba.org>
Wed, 14 Jan 2009 21:17:38 +0000 (13:17 -0800)
committerJeremy Allison <jra@samba.org>
Wed, 14 Jan 2009 21:17:38 +0000 (13:17 -0800)
Jeremy.

source3/passdb/pdb_smbpasswd.c

index f72638bed50418962dd5123dd562fdb72488d875..b72e0f2cba38ecf2b897c04d90977bdadbc48a65 100644 (file)
@@ -100,7 +100,7 @@ static bool do_file_lock(int fd, int waitsecs, int type)
        alarm(0);
        CatchSignal(SIGALRM, SIGNAL_CAST oldsig_handler);
 
-       if (gotalarm) {
+       if (gotalarm && ret == -1) {
                DEBUG(0, ("do_file_lock: failed to %s file.\n",
                        type == F_UNLCK ? "unlock" : "lock"));
                return False;