Bug 1094837 - spampd should not be started as root
Summary: spampd should not be started as root
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: spampd
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Matthias Saou
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-06 14:57 UTC by Erik Logtenberg
Modified: 2014-05-09 09:15 UTC (History)
3 users (show)

Fixed In Version: spampd-2.30-20.fc20
Clone Of:
Environment:
Last Closed: 2014-05-09 03:01:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Erik Logtenberg 2014-05-06 14:57:49 UTC
Description of problem:

The spampd service is started as root by default. The privilege drop to the spampd user/group is left to spampd, which doesn't actually drop privileges before completely initializing all SpamAssassin rule sets, thereby running an enormous amount of perl code from different sources as root.

There is no apparent reason for this, as there are no privileges required for reading the configuration and no privileged port is used either.

Systemd can take care of setting the right user, and should always be used as long as there is no good reason to do otherwise.

The fix is to simply add these two lines to the [Service] section of the spampd unit file, located at /usr/lib/systemd/system/spampd:

User=spampd
Group=spampd

The spampd binary is currently started with the "--u=spampd --g=spampd" options, which can be safely removed after adding the abovementioned lines, but this does cause spampd to try and become uid and gid 12 (mail), resulting in two ugly log lines:

spampd[31243]: Setting gid to "12 12"
spampd[31243]: Couldn't become gid "12": Bewerking niet toegestaan

So my humble advice is to just leave the "--u=spampd --g=spampd" options in there, so the log stays clean (that will prevent spampd from trying to change its uid).

Comment 1 Fedora Update System 2014-05-06 22:13:52 UTC
spampd-2.30-20.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/spampd-2.30-20.fc20

Comment 2 Fedora Update System 2014-05-08 10:08:51 UTC
Package spampd-2.30-20.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing spampd-2.30-20.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-6114/spampd-2.30-20.fc20
then log in and leave karma (feedback).

Comment 3 Fedora Update System 2014-05-09 03:01:31 UTC
spampd-2.30-20.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 4 Erik Logtenberg 2014-05-09 09:15:25 UTC
Thanks for picking this up so quickly,


Note You need to log in before you can comment on or make changes to this bug.