Mailing List Archive

Strange behavior wrt UID/EUID with system filter/perl
Hi,

While trying to debug/test my AMaViS-ng's system filter+embedded Perl
setup, I have run across a few strange things:

All the Perl code is called from the system filter, and it is run from
the Exim user (which on Debian is mail(8)). I was testing with
$ mail bengen < $file.

If I set perl_at_start to "false", Perl tells me that it is running as
UID=root,EUID=mail. This seems OK to me: In normal operation (no
"security" option set), can drop its EUID to the mail user, run the
system filter (and my script), and return to its previous state.

However, if I set perl_at_start to "false", I am told that the code is
running as UID=root,EUID=root. But all the files that are generated
(during digesting the messages) are owned by mail.

Does Perl cache the results from getuid, geteuid for its $<, $>
variables in memory, only to modify or invalidate them on certain
system calls? Or is there another explanation for this strange
behavior?

-Hilko
Re: Strange behavior wrt UID/EUID with system filter/perl [ In reply to ]
On 16 Jul 2002, Hilko Bengen wrote:

> While trying to debug/test my AMaViS-ng's system filter+embedded Perl
> setup, I have run across a few strange things:

Which release of Exim? It matters - Exim 4 handles uids/euids very
differently.

--
Philip Hazel University of Cambridge Computing Service,
ph10@cus.cam.ac.uk Cambridge, England. Phone: +44 1223 334714.
Re: Strange behavior wrt UID/EUID with system filter/perl [ In reply to ]
Philip Hazel <ph10@cus.cam.ac.uk> writes:

> On 16 Jul 2002, Hilko Bengen wrote:
>
> > While trying to debug/test my AMaViS-ng's system filter+embedded Perl
> > setup, I have run across a few strange things:
>
> Which release of Exim? It matters - Exim 4 handles uids/euids very
> differently.

3.35. I'll give it a try with Exim 4 as soon as I am done with my
Debian packages.

't was too late when I posted, I suppose. ;-)

Anyhow, does anyone know if Perl "caches" the UID/EUID for use in the
$< and $> variables?

-Hilko