You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spamassassin.apache.org by bu...@bugzilla.spamassassin.org on 2004/06/02 19:52:54 UTC

[Bug 3456] New: Error in unixlocker awl stat[3] variable not defined.

http://bugzilla.spamassassin.org/show_bug.cgi?id=3456

           Summary: Error in unixlocker awl stat[3] variable not defined.
           Product: Spamassassin
           Version: 2.63
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P5
         Component: spamassassin
        AssignedTo: spamassassin-dev@incubator.apache.org
        ReportedBy: admin@cs.montana.edu


Result:
Outputs error message about unable to lock awl file, and then error message 
about how it is unable to unlock the file.

Repro:
Debian 2.63-1
local.cf:
bayes_learn_to_journal 1
bayes_journal_max_size 5120000 

bayes_auto_learn_threshold_nonspam   0.4
bayes_auto_learn_threshold_spam 12

Fix:
It appears in the file UnixLocker.pm that the stat[3] array is not defined 
correctly in some situations, and does not handle situations in which it is not 
defined.
Attached is my attempt at a unified diff to troubleshoot the problem.
If stat[3] is not defined, then assume that lockfile was not created.
As you well realize, I'm must checking to make sure stat[3] is defined before 
comparing against it. 
This patch solves the problem as perl spews out an error message that stat[3] 
is not defined which can then generates a temporary delivery error, depending 
on what mta+sa combo you are using.

versus 2.63
--- UnixLocker.pm.original      Wed Jun  2 11:43:51 2004
+++ UnixLocker.pm       Wed Jun  2 11:44:49 2004
@@ -66,6 +66,11 @@
     }
     # link _may_ return false even if the link _is_ created
     @stat = stat($lock_tmp);
+    if (!defined ($stat[3])){
+    dbg ("lock: $$ link to lock not defined");
+    $is_locked=0;
+    last;
+    }
     if ($stat[3] > 1) {
       dbg("lock: $$ link to $lock_file: stat ok");
       $is_locked = 1;



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