http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5518
------- Additional Comments From [EMAIL PROTECTED] 2007-06-15 09:05 -------
...and this is what amavisd-new does, if it is allowed to change uid
and gid by itself (otherwise Net::Server does it):
$( = $gid; # real GID
$) = "$gid $gid"; # effective GID
POSIX::setuid($uid) or die "Can't setuid to $uid: $!";
$> = $uid; $< = $uid; # just in case
# print STDERR "desired user=$desired_user ($uid), current: EUID: $> ($<)\n";
# print STDERR "desired group=$desired_group, current: EGID: $) ($()\n";
$> != 0 or die "Still running as root, aborting\n";
$< != 0 or die "Effective UID changed, but Real UID is 0\n";
and later on, to make sure Net::Server did the right thing:
my($euid) = $>; # effective UID
$> = 0; # try to become root
POSIX::setuid(0) if $> != 0; # and try some more
if ($> == 0 || $euid == 0) { # succeded? panic!
die ...
}
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.