develooper Front page | perl.perl5.porters | Postings from January 2011

Re: Turn $$ into a magical readonly variable that always fetchesgetpid()

Thread Previous | Thread Next
From:
Zefram
Date:
January 4, 2011 05:32
Subject:
Re: Turn $$ into a magical readonly variable that always fetchesgetpid()
Message ID:
20110104133201.GO25547@lake.fysh.org
Leon Timmermans wrote:
>Those seem to be cached in PL_uid, PL_euid, PL_gid and PL_egid.
...
>                                                             Unlike $$
>I've never heard of a anyone who ran into issues due to this though.

I *would have* run into an issue here if I'd been using that part of
Perl about a decade ago.  When I worked at Sun (hacking Solaris device
drivers), my preferred way of getting root for test purposes was to drop
to the PROM monitor and poke into the process credentials structure for
my shell process.  (Aided by a shell function to work out and display
the line of Forth code required.)  It was noticeable that zsh does call
geteuid() anew each time it is required: the next prompt would show "#",
without the shell having been told anything specific about the change.

-zefram

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About