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 2007/08/31 23:05:35 UTC

[Bug 5637] New: bayes_file_mode is handled incorrectly when creating bayes.mutex

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

           Summary: bayes_file_mode is handled incorrectly when creating
                    bayes.mutex
           Product: Spamassassin
           Version: 3.2.3
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P5
         Component: spamassassin
        AssignedTo: dev@spamassassin.apache.org
        ReportedBy: klao@cs.elte.hu


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.



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

[Bug 5637] [review] bayes_file_mode is handled incorrectly when creating bayes.mutex

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5637


maddoc@maddoc.net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|needs 1 votes for 3.2       |can be commited




------- Additional Comments From maddoc@maddoc.net  2007-12-22 16:29 -------
+1



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

[Bug 5637] [review] bayes_file_mode is handled incorrectly when creating bayes.mutex

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5637


jm@jmason.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|bayes_file_mode is handled  |[review] bayes_file_mode is
                   |incorrectly when creating   |handled incorrectly when
                   |bayes.mutex                 |creating bayes.mutex
  Status Whiteboard|                            |needs 2 votes for 3.2
   Target Milestone|Undefined                   |3.2.4




------- Additional Comments From jm@jmason.org  2007-11-23 01:50 -------
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.




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

[Bug 5637] [review] bayes_file_mode is handled incorrectly when creating bayes.mutex

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5637


sidney@sidney.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Status Whiteboard|needs 2 votes for 3.2       |needs 1 votes for 3.2




------- Additional Comments From sidney@sidney.com  2007-12-21 12:29 -------
+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.




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

[Bug 5637] [review] bayes_file_mode is handled incorrectly when creating bayes.mutex

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5637


jm@jmason.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From jm@jmason.org  2007-12-28 05:15 -------
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.




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

[Bug 5637] bayes_file_mode is handled incorrectly when creating bayes.mutex

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5637





------- Additional Comments From klao@cs.elte.hu  2007-08-31 14:07 -------
Created an attachment (id=4112)
 --> (http://issues.apache.org/SpamAssassin/attachment.cgi?id=4112&action=view)
trivial fix




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

[Bug 5637] bayes_file_mode is handled incorrectly when creating bayes.mutex

Posted by bu...@bugzilla.spamassassin.org.
http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5637





------- Additional Comments From phil.randal@gmail.com  2007-11-22 14:34 -------
Nudges the SA developers...

I hit this bug today.

Any chance of the fix going in to 3.2.4 and 3.3.0?



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