From: Jeremy Allison Date: Wed, 14 Jan 2009 21:17:38 +0000 (-0800) Subject: Fix bug #6035 - Possible race between fcntl F_SETLKW and alarm delivery. X-Git-Tag: samba-4.0.0alpha6~100 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b3e6247a9eb27835a71d6b42b33b51a48f35b862;p=thirdparty%2Fsamba.git Fix bug #6035 - Possible race between fcntl F_SETLKW and alarm delivery. Jeremy. --- diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c index f72638bed50..b72e0f2cba3 100644 --- a/source3/passdb/pdb_smbpasswd.c +++ b/source3/passdb/pdb_smbpasswd.c @@ -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;