SA Bugzilla – Bug 3458
Error in unixlocker awl stat[3] variable not defined.
Last modified: 2004-06-02 03:03:48 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;
oops doublepost on a page refresh, deleting. *** This bug has been marked as a duplicate of 3456 ***