develooper Front page | perl.perl5.porters | Postings from December 2017

Re: [perl #104060] Writing to $> and friends hide errors

Thread Next
December 11, 2017 06:24
Re: [perl #104060] Writing to $> and friends hide errors
Message ID:
Ricardo SIGNES wrote:
>So some of the options:
>1. deprecate assigning to these vars, giving a long deprecation period
>(2yr) to let the deprecation warnings hit people using vendorperls;
>after that period, assigning to $<,etc. is fatal

I'd like to see us deprecate writing to $< et al.  Interestingly,
and fairly unsurprisingly, making writing to them fatal doesn't cause
any failures in the core test suite, which implies that the moderately
tricky porting code around ID-swapping syscalls is all going untested.
Quite apart from the error-prone usage, this maintenance issue is a good
reason to punt this job to a module for which this is the raison d'etre.

Of course, we need to have such a module that we can confidently point
users towards.  Unix::SavedIDs (with bonus Unix::SetUser in the distro)
looks somewhat like it could become that module, but it isn't there yet.
(I suspect that this is the module that LeonT was referring to as a "good
module on CPAN for [gs]etres[ug]id".)  Its test suite is broken on current
Perls due to the removal of POSIX::tmpnam().  It's also a problem that
it's specifically about setresuid(), which isn't available on all Unices
that have saved IDs, let alone on all Unices.  Unix::SetUser probably
needs to be split from Unix::SavedIDs, because its concept doesn't depend
on having saved IDs.  So there's porting work to be done here.


Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About