New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No error on assignment to $> #1969
Comments
From mjtg@cus.cam.ac.ukShouldn't this (run in an unprivileged environment) cause some sort perl5.6.0 -wle '$> = 0; print $>' Mike Guy % perl -V Characteristics of this binary (from libperl): |
From [Unknown Contact. See original ticket]
Perl doesn't give warnings on syscall failures. --tom |
From [Unknown Contact. See original ticket]Tom Christiansen <tchrist@chthon.perl.com> wrote
Ah! Of course it doesn't. Silly me. But perhaps the documentation of $> (and all the rest that hide system Mike Guy |
From @smpeters
Attached is a patch to perlvar.pod to document the variables I found |
From @smpetersperlvar.pod.patch--- perlvar.pod.orig Sat Nov 20 22:18:40 2004
+++ perlvar.pod Sat Nov 20 22:34:55 2004
@@ -765,7 +765,9 @@
The real uid of this process. (Mnemonic: it's the uid you came I<from>,
if you're running setuid.) You can change both the real uid and
-the effective uid at the same time by using POSIX::setuid().
+the effective uid at the same time by using POSIX::setuid(). Since
+changes to $< require a system call, check $! after a change attempt to
+detect any possible errors.
=item $EFFECTIVE_USER_ID
@@ -779,7 +781,8 @@
($<,$>) = ($>,$<); # swap real and effective uid
You can change both the effective uid and the real uid at the same
-time by using POSIX::setuid().
+time by using POSIX::setuid(). Changes to $> require a check to $!
+to detect any possible errors after an attempted change.
(Mnemonic: it's the uid you went I<to>, if you're running setuid.)
C<< $< >> and C<< $> >> can be swapped only on machines
@@ -802,7 +805,8 @@
back to C<$(> without being forced numeric, such as by adding zero.
You can change both the real gid and the effective gid at the same
-time by using POSIX::setgid().
+time by using POSIX::setgid(). Changes to $( require a check to $!
+to detect any possible errors after an attempted change.
(Mnemonic: parentheses are used to I<group> things. The real gid is the
group you I<left>, if you're running setgid.)
@@ -828,6 +832,8 @@
You can change both the effective gid and the real gid at the same
time by using POSIX::setgid() (use only a single numeric argument).
+Changes to $) require a check to $! to detect any possible errors
+after an attempted change.
(Mnemonic: parentheses are used to I<group> things. The effective gid
is the group that's I<right> for you, if you're running setgid.)
|
From rick@bort.caOn Sun, Nov 21, 2004 at 04:38:09AM -0000, Steve Peters via RT wrote:
You neglected to mention the need to initialize $! to 0 before the -- |
From @rgsSteve Peters via RT wrote:
Thanks, applied as change #23532 to bleadperl. -- |
@smpeters - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#3242 (status was 'resolved')
Searchable as RT3242$
The text was updated successfully, but these errors were encountered: