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

source/passdb/pdb_smbpasswd.c

index e01b4b1855c7d9c75d16db9eac86f8d639001016..18fbe88859b96e2369b14270a6b802b0a9b46f55 100644 (file)
@@ -101,7 +101,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;