You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by JLG <jl...@mac.com> on 2008/04/22 07:37:13 UTC

Perl/SA permissions problem?

Problem: I can run sa-learn as root, but not as any other user.

I'm using SpamAssassin version 3.2.4, running on Perl version 5.8.6,  
running on Mac OS X Server 10.4.11. All of this was working before I  
updated to SpamAssassin 3.2.4, but I updated a lot of other perl  
modules at the same time, so I can't be sure that SA itself is the  
culprit. Best as I can tell, this is some sort of permissions problem,  
but it's a real bugger because it's broken all of my sa-learn tools,  
most of which execute sa-learn as clamav.

Logged in as root:

# /usr/local/bin/sa-learn --dbpath /var/amavis/.spamassassin --sync
bayes: synced databases from journal in 1 seconds: 1565 unique entries  
(3164 total entries)

However, it doesn't work when executed as another user:

# sudo -u clamav  /usr/local/bin/sa-learn --dbpath /var/ 
amavis/.spamassassin --sync
Can't locate Pod/Simple.pm in @INC (@INC contains: /System/Library/ 
Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 / 
Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 / 
Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level / 
Network/Library/Perl/5.8.6 /Network/Library/Perl /System/Library/Perl/ 
Extras/5.8.6/darwin-thread-multi-2level /System/Library/Perl/Extras/ 
5.8.6 /Library/Perl/5.8.1/darwin-thread-multi-2level /Library/Perl/ 
5.8.1) at /System/Library/Perl/5.8.6/Pod/Text.pm line 34.
BEGIN failed--compilation aborted at /System/Library/Perl/5.8.6/Pod/ 
Text.pm line 34.
Compilation failed in require at /System/Library/Perl/5.8.6/Pod/ 
Usage.pm line 436.
BEGIN failed--compilation aborted at /System/Library/Perl/5.8.6/Pod/ 
Usage.pm line 443.
Compilation failed in require at /usr/local/bin/sa-learn line 26.
BEGIN failed--compilation aborted at /usr/local/bin/sa-learn line 26.

The @INC values are identical:

# perl -le 'print "@INC"'
/System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/ 
Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/ 
Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread- 
multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/ 
Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/ 
Perl/Extras/5.8.6 /Library/Perl/5.8.1/darwin-thread-multi-2level / 
Library/Perl/5.8.1 .

# sudo -u clamav perl -le 'print "@INC"'
/System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/ 
Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/ 
Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread- 
multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/ 
Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/ 
Perl/Extras/5.8.6 /Library/Perl/5.8.1/darwin-thread-multi-2level / 
Library/Perl/5.8.1 .

Permissions on the Bayes stuff are OK:

# ls -sla /var/amavis/.spamassassin
total 50024
     0 drwx------    6 clamav  amavis       204 Apr 22 00:23 .
     0 drwxr-x---   10 clamav  amavis       340 Apr 21 21:18 ..
19760 -rw-------    1 clamav  amavis  10117120 Apr 22 00:23 auto- 
whitelist
    32 -rw-rw-rw-    1 clamav  amavis     14976 Apr 22 00:23  
bayes_journal
20264 -rw-------    1 clamav  amavis  10375168 Apr 22 00:22 bayes_seen
  9968 -rw-rw-rw-    1 clamav  amavis   5103616 Apr 22 00:22 bayes_toks

Here's an interesting bit: if I start amavisd-new as the clamav user,  
it gives a similar error (it complains about a different perl module,  
but has the same error syntax). If I start amavisd-new as root, it  
works perfectly--even though it's configuration is such that it  
switches to the clamav user internally as it starts up! So, this  
problem is not limited to SA; I'm thinking it's something with  
perl...but all the modules in question are properly installed, I've  
even done a "force install" on them to be sure. Everything compiles,  
tests, and installs without a hitch.

Any ideas? I'm at a loss.

Thanks,
Jon