From: Steve Peters Date: Sun, 21 Nov 2004 04:38:09 +0000 (+0000) Subject: [perl #3242] [PATCH]No error on assignment to $> X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a537debe17982e491ffa12d12441cf74a452acb2;p=p5sagit%2Fp5-mst-13.2.git [perl #3242] [PATCH]No error on assignment to $> From: "Steve Peters via RT" Message-ID: p4raw-id: //depot/perl@23532 --- diff --git a/pod/perlvar.pod b/pod/perlvar.pod index 8fc7441..292f444 100644 --- a/pod/perlvar.pod +++ b/pod/perlvar.pod @@ -765,7 +765,9 @@ you may use the CPAN module C. The real uid of this process. (Mnemonic: it's the uid you came I, 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 @@ The effective uid of this process. Example: ($<,$>) = ($>,$<); # 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, if you're running setuid.) C<< $< >> and C<< $> >> can be swapped only on machines @@ -802,7 +805,8 @@ set the real gid. So the value given by C<$(> should I be assigned 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 things. The real gid is the group you I, if you're running setgid.) @@ -828,6 +832,8 @@ list, say C< $) = "5 5" >. 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 things. The effective gid is the group that's I for you, if you're running setgid.)