http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5333

           Summary: File locking not thread safe (uses $$ in filename)
           Product: Spamassassin
           Version: SVN Trunk (Latest Devel Version)
          Platform: Other
               URL: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=398831
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Libraries
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Package: spamassassin
Version: 3.1.7-1
Severity: important
Tags: patch

In /usr/share/perl5/Mail/SpamAssassin/Locker/UnixNFSSafe.pm a lock
filename is constructed using the $$ variable. However, in a
multithreaded application, like mimedefang-multiplexor, $$ has the same
value in all threads, causing errors like the following:

Nov 15 20:46:50 comedy mimedefang-multiplexor[26981]: Slave 0 stderr:
print() on closed filehandle LTMP at
/usr/share/perl5/Mail/SpamAssassin/Locker/UnixNFSSafe.pm line 146.
stat() on closed filehandle LTMP at
/usr/share/perl5/Mail/SpamAssassin/Locker/UnixNFSSafe.pm line 148.
locker: safe_unlock: failed to create lock tmpfile
/var/spool/MIMEDefang/.spamassassin/auto-whitelist.lock.comedy.dante.de.26981
at
/usr/share/perl5/Mail/SpamAssassin/Locker/UnixNFSSafe.pm line 149.
Nov 15 20:47:18 comedy mimedefang-multiplexor[26981]: Slave 3 stderr:
locker: safe_lock: unlink of temp lock
/var/spool/MIMEDefang/.spamassassin/auto-whitelist.lock.comedy.dante.de.26981
failed: No such file or directory

Solution (from the perlvar man page): Use the getpid function from
Linux::Pid.

The patch implements this, as well as some additional error checking.


Patch available at URL above



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to