/[Apache-SVN]/spamassassin/trunk/spamd/spamd.raw
ViewVC logotype

Diff of /spamassassin/trunk/spamd/spamd.raw

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- spamassassin/trunk/spamd/spamd.raw	2005/05/03 03:40:18	167850
+++ spamassassin/trunk/spamd/spamd.raw	2005/05/03 03:41:12	167851
@@ -842,6 +842,17 @@ sub spawn {
       # 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";
       }

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26