Bug 5163 - spamd drops root rights too late (after installing default config)
Summary: spamd drops root rights too late (after installing default config)
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: 3.1.3
Hardware: Other other
: P5 normal
Target Milestone: 3.2.1
Assignee: SpamAssassin Developer Mailing List
URL: http://bugs.debian.org/cgi-bin/bugrep...
Whiteboard:
Keywords:
Depends on: 5480
Blocks:
  Show dependency tree
 
Reported: 2006-11-01 21:44 UTC by spamassassin
Modified: 2007-06-11 13:27 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description spamassassin 2006-11-01 21:44:26 UTC
I am debugging a problem in which the virtual mail folder hierarchy
is being created with the wrong user rights (root/root, rather than
vmail/vmail). I have found the culprit to be spamd.

spamd is running with options

  --create-prefs --max-children 5 --helper-home-dir --allow-tell
  --paranoid --virtual-config-dir=/srv/vmail/%d/%l/.spamassassin -x
  -D --pidfile=/var/run/spamd.pid

postfix delivers to spamc:

  spamc -x -u ${recipient} -e /usr/lib/dovecot/deliver -d ${recipient}

and this causes spamd to print the following debug info:

[4319] info: spamd: using default config for test@madduck.net:
/srv/vmail/madduck.net/test/.spamassassin/user_prefs
[4319] dbg: info: user has changed
[4319] dbg: config: using "/srv/vmail/madduck.net/test/.spamassassin" for user
state dir

note how it uses the default config (which actually means that it
installs the default config) before changing the user. As a result,
/srv/vmail/madduck.net/test will be owned by root and mode 0700 (die
to the restrictive umask I use). When later the deliver process
tries to write the mail to the directory as the vmail user, it
fails.

I think spamd should install the configuration for new users (when
it does not yet exist) only *after* dropping root rights.
Comment 1 Justin Mason 2007-05-24 13:42:53 UTC
needs looking at/fixing for 3.2.1
Comment 2 Sidney Markowitz 2007-06-05 00:03:44 UTC
Leaving in 3.2.1 queue even though not in review state yet -- I think this will
make it in time.
Comment 3 Justin Mason 2007-06-11 13:27:40 UTC
this is now fixed (as a result of bug 5480 being fixed).