Bug 7763 - ssl tests must be run as root
Summary: ssl tests must be run as root
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Building & Packaging (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: PC Linux
: P2 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
Depends on:
Reported: 2019-10-18 18:04 UTC by Noah Meyerhans
Modified: 2020-04-10 19:12 UTC (History)
2 users (show)

Attachment Type Modified Status Actions Submitter/CLA Status
spamd_tests_use_unprivileged_port.diff patch None Noah Meyerhans [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Noah Meyerhans 2019-10-18 18:04:41 UTC
Created attachment 5678 [details]

The tests in t/spamd_ssl.t and t/spamd_ssl_accept_fail.t run spamd with the default port configuration, which uses a privileged port and must thus be run as root. Aside from binding to port 783, there's nothing about those tests that requires privileges. We should consider switching to an unprivileged port. Either that or we should skip these tests when running as non-root, but that seems unnecessary.

Proposed fix to trunk is attached. I'd apply something similar to the 3.4 branch as well.
Comment 1 Henrik Krohns 2020-04-10 07:44:45 UTC
Uses now probably_unused_spamd_port() function.

Sending        spamassassin-3.4/t/spamd_ssl.t
Sending        spamassassin-3.4/t/spamd_ssl_accept_fail.t
Sending        trunk/t/spamd_ssl.t
Sending        trunk/t/spamd_ssl_accept_fail.t
Transmitting file data ....done
Committing transaction...
Committed revision 1876346.
Comment 2 Kevin A. McGrail 2020-04-10 19:12:08 UTC
Do you think we should rename probably_unused_spamd_port() since it's now used?