Mailing List Archive

svn commit: r167851 - /spamassassin/trunk/spamd/spamd.raw
Author: jm
Date: Mon May 2 20:41:12 2005
New Revision: 167851

URL: http://svn.apache.org/viewcvs?rev=167851&view=rev
Log:
bug 3900: spamd on BSD leaves children running as root due to platform-specific perl idiosyncracy

Modified:
spamassassin/trunk/spamd/spamd.raw

Modified: spamassassin/trunk/spamd/spamd.raw
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/spamd/spamd.raw?rev=167851&r1=167850&r2=167851&view=diff
==============================================================================
--- spamassassin/trunk/spamd/spamd.raw (original)
+++ spamassassin/trunk/spamd/spamd.raw Mon May 2 20:41:12 2005
@@ -842,6 +842,17 @@
# Change UID
$> = $uuid; # effective uid
$< = $uuid; # real uid. we now cannot setuid anymore
+
+ # bug 3900: BSD perl bug. see comment in setuid_to_euid() in
+ # Mail::SA::Util on the same issue.
+ if ( $< != $uuid ) {
+ dbg("initial attempt to change real uid failed, trying BSD workaround");
+
+ $> = $<; # revert euid to ruid
+ $< = $uuid; # change ruid to target
+ $> = $uuid; # change euid back to target
+ }
+
if ( $> != $uuid and $> != ( $uuid - 2**32 ) ) {
die "spamd: setuid to uid $uuid failed\n";
}