SpamAssassin spamd -u option

Jun Kuriyama kuriyama at imgsrc.co.jp
Fri Dec 17 05:39:27 PST 2004


Hi,

I found using -u option with spamd does not work on my box.  Current
spamd uses changing euid/uid like this:

  $> = $uuid;            # effective uid
  $< = $uuid;            # real uid. we now cannot setuid anymore

But changing effective uid from root to specified user causes
impossible to change real uid lator.

The problem of this is, when forked spamd child finishes first
process, effective uid is back to root, rather than keeping specified
user id.

On my box, this patch seems to work fine.  How about adding this
patch?  (and 3.0.2 was released, btw).

--- spamd/spamd.raw.orig	Fri Dec 17 22:31:18 2004
+++ spamd/spamd.raw	Fri Dec 17 22:31:36 2004
@@ -699,8 +699,8 @@
   $( = $ugid;            # real gid
 
   # Change UID
-  $> = $uuid;            # effective uid
   $< = $uuid;            # real uid. we now cannot setuid anymore
+  $> = $uuid;            # effective uid
   if ( $> != $uuid and $> != ( $uuid - 2**32 ) ) {
     die "fatal: setuid to uid $uuid failed\n";
   }


-- 
Jun Kuriyama <kuriyama at imgsrc.co.jp> // IMG SRC, Inc.
             <kuriyama at FreeBSD.org> // FreeBSD Project


More information about the freebsd-perl mailing list