You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2005/04/27 19:59:01 UTC

svn commit: r165019 - /spamassassin/trunk/spamd/spamd.raw

Author: jm
Date: Wed Apr 27 10:59:01 2005
New Revision: 165019

URL: http://svn.apache.org/viewcvs?rev=165019&view=rev
Log:
bug 3897: spamd -u causes child spamds to change back to 'root' euid on BSD

Modified:
    spamassassin/trunk/spamd/spamd.raw

Modified: spamassassin/trunk/spamd/spamd.raw
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/spamd/spamd.raw?rev=165019&r1=165018&r2=165019&view=diff
==============================================================================
--- spamassassin/trunk/spamd/spamd.raw (original)
+++ spamassassin/trunk/spamd/spamd.raw Wed Apr 27 10:59:01 2005
@@ -889,12 +889,14 @@
       }
 
       # if we changed UID during processing, change back!
-      if ( $> != $< and $> != ( $< - 2**32 ) ) {
+      if ($setuid_to_user && ($> != $<) && ($> != ($< - 2**32))) {
         $) = "$( $(";    # change eGID
         $> = $<;         # change eUID
-        if ( $> != $< and $> != ( $< - 2**32 ) ) {
-           # make it fatal to avoid security breaches
-	   die("spamd: return setuid failed");
+
+        # check again; ensure the change happened
+        if ($> != $< && ($> != ( $< - 2**32))) {
+          # make it fatal to avoid security breaches
+          die("spamd: return setuid failed");
         }
       }