SA Bugzilla – Bug 5637
[review] bayes_file_mode is handled incorrectly when creating bayes.mutex
Last modified: 2007-12-28 05:15:55 UTC
bayes_file_mode value is not handled correctly in Locker/Flock.pm, which results in weird permissions on bayes.mutex. Which then results in bayes: expire_old_tokens: locker: safe_lock: cannot create lockfile /var/lib/spamd/bayes.mutex: Permission denied kind of errors. The root of the problem is that everywhere except Flock.pm:safe_lock() it is used as string. (It's always used as oct($main->{conf}->{bayes_file_mode}).) And safe_lock() could use octal string and numeric values. The default is string '0700' which works. But otherwise it's specified as $CONF_TYPE_NUMERIC, so if I put 0770 in config file, it'll get _decimal_ value 700, which is octal 1402, which is bad. (The resulting bayes.mutex file get permissions as -r------w-) Sorry for the lengthy description. Anyway, the fix is trivial: just specify it as $CONF_TYPE_STRING. Patch is attached.
Created attachment 4112 [details] trivial fix
Nudges the SA developers... I hit this bug today. Any chance of the fix going in to 3.2.4 and 3.3.0?
thanks for the nudge! I'd missed it. +1 from me it's in 3.3.0 trunk: : jm 82...; svn commit -m "bug 5637: bayes_file_mode is handled incorrectly when creating bayes.mutex, resulting in incorrect permissions on that file; fix by Mihaly Barasz" lib Sending lib/Mail/SpamAssassin/Conf.pm Sending lib/Mail/SpamAssassin/Locker/Flock.pm Transmitting file data .. Committed revision 597617.
+1 In case someone else is as naive about using the patch program as I was, this attachment requires a "-p1" option to patch instead of the usual p0.
+1
applied to 3.2.x: : jm 238...; svn commit -m "bug 5637: bayes_file_mode is handled incorrectly when creating bayes.mutex, resulting in incorrect permissions on that file; fix by Mihaly Barasz" Sending lib/Mail/SpamAssassin/Conf.pm Sending lib/Mail/SpamAssassin/Locker/Flock.pm Transmitting file data .. Committed revision 607236.