Bug 3458 - Error in unixlocker awl stat[3] variable not defined.
Summary: Error in unixlocker awl stat[3] variable not defined.
Status: RESOLVED DUPLICATE of bug 3456
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamassassin (show other bugs)
Version: 2.63
Hardware: PC Linux
: P5 minor
Target Milestone: 3.1.0
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-02 11:02 UTC by Lucas Albers
Modified: 2004-06-02 03:03 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Albers 2004-06-02 11:02:33 UTC
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;
Comment 1 Lucas Albers 2004-06-02 11:03:48 UTC
oops doublepost on a page refresh, deleting.

*** This bug has been marked as a duplicate of 3456 ***