Bug 3908 - lock: unlink of lock file failed when using autowhitelisting.
Summary: lock: unlink of lock file failed when using autowhitelisting.
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Libraries (show other bugs)
Version: unspecified
Hardware: All Solaris
: P5 normal
Target Milestone: 3.1.0
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-19 08:36 UTC by Mike Schwarz
Modified: 2005-04-30 12:05 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status
Proposed patch for version 2.64 patch None Mike Schwarz [NoCLA]
Proposed patch for version 3.0.0 patch None Mike Schwarz [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Schwarz 2004-10-19 08:36:39 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
Comment 1 Mike Schwarz 2004-10-19 08:38:59 UTC
Created attachment 2463 [details]
Proposed patch for version 2.64
Comment 2 Mike Schwarz 2004-10-19 08:39:45 UTC
Created attachment 2464 [details]
Proposed patch for version 3.0.0
Comment 3 Bob Menschel 2005-04-28 21:17:00 UTC
Looks like a simple enough patch to be added to and validated within 3.1.0
Comment 4 Daniel Quinlan 2005-04-30 20:03:47 UTC

*** This bug has been marked as a duplicate of 4291 ***
Comment 5 Daniel Quinlan 2005-04-30 20:05:06 UTC
PEBKAC
Comment 6 Daniel Quinlan 2005-04-30 20:05:38 UTC
this is fixed in HEAD, I agree with the proposed fix, thanks