develooper Front page | perl.perl5.porters | Postings from April 2012

Re: [perl #112374] Failure with ($>, $<) = ($<, $>) on linux.

Thread Previous | Thread Next
From:
Leon Timmermans
Date:
April 10, 2012 03:24
Subject:
Re: [perl #112374] Failure with ($>, $<) = ($<, $>) on linux.
Message ID:
CAHhgV8i8YqF0PqnJP0kHru=J00jReZYxdFfV1DypCxOsJwuBKg@mail.gmail.com
On Tue, Apr 10, 2012 at 8:09 AM, david.Ingamells@mapscape.eu
<perlbug-followup@perl.org> wrote:
> This bug was first reported to the Ubuntu team as bug number 576984 a long time ago
> and I have been supporting a patched version (as described below) at our site ever since. They clearly didn't care :(
> I hope that you do :)
>
> The following perl (from perl-base) script fails in the new LTS Ubuntu 10.04, it works in LTS version 8.04.
>
> It tests the perl statement
>
>    ($>, $<) = ($<, $>)
>
> which is documented in perl's perlvar maunal page, also in version 5.14.1.
> I have tested this with perl 5.10.1 and 5.12 but not with 5.14.

Why are you doing this in the first place? In particular, why are you
setting the real user id? This trick was only necessary on BSD before
it supported saved userids (1994). You either want to change only the
effective id, or all ids.

BTW I can reproduce this is 5.12 but not in 5.14 (don't have 5.10 at
hand). Sounds like a bisect is in order.

> In mg.c use setresuid by preference if it is available and set the saved uid (3rd argument) to the other value so that
> both values (real and effective) are always present among the 3 values the system knows (real, effective and saved).

That codepath should not be used in this case, it should use delayed
assignment. This solution seems way too brittle, then again I've
proposed removing this entire idiom since it's no longer of use in
this millennium.

Leon

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