[Gllug] Re: SpamAssassin uid/gid

Jon Dye jon at pecorous.co.uk
Wed Mar 14 10:31:11 UTC 2007


Nix wrote:
> On 13 Mar 2007, Jon Dye verbalised:
>> I've just installed a plug-in to spamassassin which attempts to
>> write to its own log file.

>> When I use spamd (running as root) and spamc (run as me), spamd
>> can't write to that file.  After putting some debugging into the 
>> relevant plug-in I've discovered that spamd changes uid and gid to
>> that of my user (from root) but it only contains my primary group
>> in the list of groups and therefore not the required group.
> 
> This is done by Mail::SpamAssassin::Util::setuid_to_euid(), which is 
> very tricky to keep working because there are Perl bugs on various 
> platforms which break uid changing in various different ways.

I had a look at that function before posting but I know nearly no perl
at all so I didn't even want to attempt to change it.  It took me a
while just to work out what $<, $>, $( and $) were, (although I expected
such cryptic variable from perl and thankfully I know enough to use
perldoc to find the answers).

> This function does not even attempt to set the supplementary group 
> list. Maybe it should.
> 
>> Does anyone have any experience of spamassassin or any tips on what
>> I could do to get this to work properly with spamd?
> 
> The only sane way to fix this is to fix the plugin to use the logging
>  facilities from Mail::SpamAssassin::Logger, which will use the
> syslog properly. Writing to files is fraught with trickinesses due to
> the manifold ways SA can be invoked (look at the various file-based 
> BayesStore methods for more nasty warts than you can easily
> imagine...)
> 
> (Thankfully Mail::SpamAssassin::Logger is really easy to use, and if 
> your only problem is a logfile then you won't need to bother with
> those warts.)
> 
> (Which plugin is this, btw? I might fix it myself...)

FuzzyOcr

Alternatively if you have a recommendation for a different plug-in with
similar features that would also be welcome.

JD

-- 
"Looking kinda cool. Looking kinda cool. Looking kinda cool. Looking
like a d***head.  "
		- Eddie Izzard

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 257 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20070314/fc5f3381/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list