Bug 1559 - pyzor will not run
Summary: pyzor will not run
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Rules (Eval Tests) (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: PC Linux
: P2 normal
Target Milestone: 2.50
Assignee: Malte S. Stretz
URL:
Whiteboard:
Keywords: backport
Depends on:
Blocks:
 
Reported: 2003-02-25 10:27 UTC by Graham Murray
Modified: 2003-03-13 09:51 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status
fix for the problem patch None Theo Van Dinter [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Murray 2003-02-25 10:27:05 UTC
Pyzor will not run from within Dns.pm. I have added debug to print out the
complete response, and it seem that it (something) thinks that the user's home
directory is '/bin'

debug: executable for pyzor was found at /usr/bin/pyzor
debug: Pyzor is available: /usr/bin/pyzor
debug: entering helper-app run mode
debug: Pyzor command: /usr/bin/pyzor  check < '/tmp/sa.30508.BhnbyN' 2>&1
debug: Pyzor: got response: Traceback (most recent call last):
debug: Pyzor: got response:   File "/usr/bin/pyzor", line 4, in ?
debug: Pyzor: got response:     pyzor.client.run()
debug: Pyzor: got response:   File "/usr/lib/python2.2/site-packages/pyzor/clien
t.py", line 934, in run
debug: Pyzor: got response:     ExecCall().run()
debug: Pyzor: got response:   File "/usr/lib/python2.2/site-packages/pyzor/clien
t.py", line 169, in run
debug: Pyzor: got response:     os.mkdir(homedir)
debug: Pyzor: got response: OSError: [Errno 13] Permission denied: '/bin/.pyzor'
Comment 1 Graham Murray 2003-02-26 22:36:13 UTC
It would seem as though pyzor will run if called from spamd but not if it is
called from spamassassin. Also it works perfectly if called directly from the
command line, so it looks as though something is corrupting the environment in
which spamassassin calls it. It also works fine in 2.50 (release)
Comment 2 Theo Van Dinter 2003-02-27 09:47:20 UTC
Subject: Re: [SAdev]  pyzor will not run

On Wed, Feb 26, 2003 at 10:36:14PM -0800, bugzilla-daemon@hughes-family.org wrote:
> It would seem as though pyzor will run if called from spamd but not if it is
> called from spamassassin. Also it works perfectly if called directly from the
> command line, so it looks as though something is corrupting the environment in
> which spamassassin calls it. It also works fine in 2.50 (release)

What comes out of "spamassassin -D < message > /dev/null" ?  It's likely
that pyzor doesn't exist in the path, or has bad permissions, etc.

Comment 3 Graham Murray 2003-02-27 10:56:16 UTC
The appropriate part of the output of spamasassin -D < msg > /dev/null is

debug: Razor2 is available
debug: Current PATH is:
/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome2/bin:/opt/gnome/bin:/opt/kde3/bin:/opt/kde2/bin:/usr/lib/java/bin:/opt/gnome/bin:.
debug: executable for pyzor was found at /usr/bin/pyzor
debug: Pyzor is available: /usr/bin/pyzor
debug: entering helper-app run mode
debug: Pyzor: got response: Traceback (most recent call last):
debug: leaving helper-app run mode
debug: Pyzor: couldn't grok response "Traceback (most recent call last):"
debug: executable for dccproc was found at /usr/local/bin/dccproc


So it has found the pyzor executable but this has failed. The original bug
report shows the error in more detail (permissions failure on the non-existant
directory /bin/.pyzor)
Comment 4 Theo Van Dinter 2003-02-27 12:47:38 UTC
Subject: Re: [SAdev]  pyzor will not run

On Thu, Feb 27, 2003 at 10:56:16AM -0800, bugzilla-daemon@hughes-family.org wrote:
> So it has found the pyzor executable but this has failed. The original bug
> report shows the error in more detail (permissions failure on the non-existant
> directory /bin/.pyzor)

Ok, after some digging, the problem is that
Mail::SpamAssassin::Util::portable_getpwuid() is returning the wrong
information.

For instance, I pass in my UID (501) and end up with:

bin:x:1:1:::bin:/bin:/bin/false

Comment 5 Theo Van Dinter 2003-02-27 13:07:41 UTC
Subject: Re: [SAdev]  pyzor will not run

On Thu, Feb 27, 2003 at 03:47:35PM -0500, Theo Van Dinter wrote:
> Ok, after some digging, the problem is that
> Mail::SpamAssassin::Util::portable_getpwuid() is returning the wrong
> information.

Heh.  Stupid scalar vs array problem:

$ perl -e 'print join(":",t($>)),"\n"; sub t { getpwuid(@_); }'
bin:x:1:1:::bin:/bin:/bin/false
$ perl -e 'print join(":",t($>)),"\n"; sub t { getpwuid($_[0]); }'
felicity:x:501:.....

In the first one, getpwuid is expecting a scalar, so @_ gets converted
into the # of elements that are being passed == 1.  In the second one
we pass the first scalar of the array, and things work as expected.

I'll have a patch attached shortly. :)

Comment 6 Theo Van Dinter 2003-02-27 13:19:56 UTC
Created attachment 695 [details]
fix for the problem
Comment 7 Theo Van Dinter 2003-02-27 13:21:08 UTC
reassigning to myself.  waiting for comments for 2.51 inclusion. :)
Comment 8 Theo Van Dinter 2003-03-05 17:46:01 UTC
reassigning to malte. :)
Comment 9 Malte S. Stretz 2003-03-06 09:03:07 UTC
OKAY: That one is really stupid ;-) 
Comment 10 Theo Van Dinter 2003-03-13 18:51:19 UTC
committed to 2.5 branch, closing ticket. :)