Bug 1038388 - spampd cannot run perl with -T flag
Summary: spampd cannot run perl with -T flag
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: spampd
Version: 20
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Matthias Saou
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-05 03:09 UTC by Bojan Smojver
Modified: 2014-01-31 00:59 UTC (History)
2 users (show)

Fixed In Version: spampd-2.30-16.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-01-30 03:38:15 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Convert to systemd, untaint some varilables to please new Perl, dispose of PID file (5.21 KB, patch)
2013-12-09 23:55 UTC, Bojan Smojver
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Debian BTS 722159 0 None None None Never

Description Bojan Smojver 2013-12-05 03:09:57 UTC
Description of problem:
With new perl, it seems that spampd cannot run with -T flag any more. It gives this error:
------------------
Dec  5 13:53:55 <host> spampd[19897]: WARNING!! Error in process_request eval block: Insecure dependency in connect while running with -T switch at /usr/lib64/perl5/IO/Socket.pm line 115.
------------------

And then it closes the connection. This, of course, completely trips up postfix, which then queues up e-mails internally etc.

Version-Release number of selected component (if applicable):
spampd-2.30-15.noarch

How reproducible:
Always.

Steps to Reproduce:
1. Configure spampd as filter in /etc/postfix/master.cf
2. Run spampd.
3. See errors above.

Actual results:
Connection to the port spampd runs on is immediately closed.

Expected results:
Was not a problem in F-19, so regression.

Additional info:

Comment 1 Bojan Smojver 2013-12-05 03:22:48 UTC
See that Debian bug for the patch.

Comment 2 Bojan Smojver 2013-12-09 09:20:34 UTC
Just requested commit access on spampd in order to fix this. It seems that this package is mostly unmaintained.

I converted to systemd.

Comment 3 Bojan Smojver 2013-12-09 23:55:41 UTC
Created attachment 834600 [details]
Convert to systemd, untaint some varilables to please new Perl, dispose of PID file

Comment 4 Bojan Smojver 2013-12-09 23:59:35 UTC
So, the patch is here, just in case someone can pick this up before I get commit status for the package.

I'm guessing this may also address bug #678137, but in a different way. Instead of relying on PID file and then HUP-ing or what not, sa-update can just tell systemd to reload this service.

Comment 5 Bojan Smojver 2014-01-03 03:01:04 UTC
Ping... Still no response from the maintainer.

Comment 6 Fedora Update System 2014-01-28 01:07:29 UTC
spampd-2.30-16.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/FEDORA-2014-0705/spampd-2.30-16.fc20

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

Comment 8 Erik Logtenberg 2014-01-30 13:35:43 UTC
Thanks for fixing this bug, it indeed solves this issue.

Please note that in the details, a rather important notice is given:

> The environment file, /etc/sysconfig/spampd, now has a slighly
> different format. Instead of using options, use SPAMPD_OPTIONS.
> For instance:
> 
> SPAMPD_OPTIONS="--host=127.0.0.1:10026 --relayhost=127.0.0.1:10027"

I would like to suggest adding such a /etc/sysconfig/spampd file in the package, with exactly that content. The reason is that in Fedora, tcp port 10025 is reserved for Amavis, in SELinux policy as follows:

> amavisd_send_port_t tcp 10025

Now tcp/10025 also happens to be the default listener for spampd, but in the SELinux policy ports 10026 and 10027 are reserved for spampd instead:

> spamd_port_t tcp 783, 10026, 10027

So in order for spampd to actually work on Fedora you need to override the default port, which is exactly what the suggested config file does.

Additionally I might add that while spampd is now allowed to run and listen on tcp/10026, it still does not seem to be allowed to connect back on tcp/10027:

type=AVC msg=audit(1391087514.778:5806): avc:  denied  { name_connect } for  pid=3078 comm="spampd" dest=10027 scontext=system_u:system_r:spamd_t:s0 tcontext=system_u:object_r:spamd_port_t:s0 tclass=tcp_socket

If required, I can file a separate bug for this remaining issue.

Comment 9 Erik Logtenberg 2014-01-30 14:32:08 UTC
I filed a separate bug (bug #1059742) for that selinux issue.

Comment 10 Bojan Smojver 2014-01-30 21:17:02 UTC
(In reply to Erik Logtenberg from comment #8)
> Thanks for fixing this bug, it indeed solves this issue.
> 
> Please note that in the details, a rather important notice is given:
> 
> > The environment file, /etc/sysconfig/spampd, now has a slighly
> > different format. Instead of using options, use SPAMPD_OPTIONS.
> > For instance:
> > 
> > SPAMPD_OPTIONS="--host=127.0.0.1:10026 --relayhost=127.0.0.1:10027"
> 
> I would like to suggest adding such a /etc/sysconfig/spampd file in the
> package, with exactly that content.

Yeah, I can do that.

Comment 11 Bojan Smojver 2014-01-31 00:59:57 UTC
(In reply to Bojan Smojver from comment #10)

> Yeah, I can do that.

https://admin.fedoraproject.org/updates/spampd-2.30-17.fc20


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