severe error when using exim
Julian Field
mailscanner at ecs.soton.ac.uk
Fri Sep 6 21:46:53 IST 2002
Well spotted!
I'm slightly surprised no-one has noticed this before, I guess there can't
be many Exim users out there...
As you say, it's a copy-and-paste error :(
I'll get an updated version out tomorrow if I get time, it will include the
"some attachment filenames containing '%'" fix as well.
At 20:06 06/09/2002, you wrote:
>when using exim as MTA, 3.22.12 first sets the uid, then the gid
>... and fails. patch attached. there seems to be a copy & paste error
>in the group check as well.
>
>as an add on, it would be nice, if mailscanner would log the fact,
>that it exits, to syslog as well. The only thing you see now is that
>setting the gid fails. no hint on the exit.
>
>--- mailscanner/bin/mailscanner~ 2002-08-25 16:38:33.000000000 +0200
>+++ mailscanner/bin/mailscanner 2002-09-06 21:00:40.000000000 +0200
>@@ -123,6 +123,14 @@
> # Tried to set [u,g]id after writing pid, but then it fails when it
> re-execs itself.
> # Using the posix calls because I don't want to have to bother to find
> out what
> # happens when "$< = $uid" fails (i.e. not running as root). Yet.
>+if ($Config::RunAsGroup ne "") {
>+ my $gid = getgrnam($Config::RunAsGroup);
>+ if ($gid) { # Only do this if setting to non-root
>+ Log::InfoLog("ECS MailScanner setting GID to $Config::RunAsGroup
>($gid)");
>+ POSIX::setgid($gid) or Log::DieLog("Can't set GID $gid");
>+ }
>+}
>+
> if ($Config::RunAsUser ne "") {
> my $uid = getpwnam($Config::RunAsUser);
> if ($uid) { # Only do this if setting to non-root
>@@ -131,14 +139,6 @@
> }
> }
>
>-if ($Config::RunAsUser ne "") {
>- my $gid = getgrnam($Config::RunAsGroup);
>- if ($gid) { # Only do this if setting to non-root
>- Log::InfoLog("ECS MailScanner setting GID to $Config::RunAsGroup
>($gid)");
>- POSIX::setgid($gid) or Log::DieLog("Can't set GID $gid");
>- }
>-}
>-
>
> $> = $<;
> $) = $(;
--
Julian Field Teaching Systems Manager
jkf at ecs.soton.ac.uk Dept. of Electronics & Computer Science
Tel. 023 8059 2817 University of Southampton
Southampton SO17 1BJ
More information about the MailScanner
mailing list