SA Bugzilla – Bug 3908
lock: unlink of lock file failed when using autowhitelisting.
Last modified: 2005-04-30 12:05:38 UTC
We are getting multiple error messages using autowhitelisting in spamassassin with mimedefang on a sun solaris system. The syslog messages are: Oct 14 11:41:49 mail1 mimedefang-multiplexor[352]: [ID 980602 mail.info] Slave 14 stderr: lock: 9286 unlink of lock file /var/spool/spamassassin/auto-whitelist.lock failed: No such file or directory I have traced this to a race condition where the lock is checked for (exists) and then a stat on the lock is done to check for a stale lock file. The problem occurs when the lock file was removed before the stat, stat returns undef and then the lock is attempted to be removed as a stale lock. This could result in the removal of a valid lock allowing multiple access if the lock file was then created after the stat and before the unlink by another process. This exists in both version 2.64 and 3.00 in different files: version 2.64: lib/Mail/SpamAssassin/UnixLocker.pm version 3.0.0: lib/Mail/SpamAssassin/Locker/UnixNFSSafe.pm
Created attachment 2463 [details] Proposed patch for version 2.64
Created attachment 2464 [details] Proposed patch for version 3.0.0
Looks like a simple enough patch to be added to and validated within 3.1.0
*** This bug has been marked as a duplicate of 4291 ***
PEBKAC
this is fixed in HEAD, I agree with the proposed fix, thanks