X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=pod%2Fperlvar.pod;h=49cdcb273e6973eee61af3364ab9484b67726ca5;hb=7817ba4dfeb754838a0da8f159127895c2dcf4fc;hp=83f4d9cd9e61ad375b863b2fc06a5841bc08194c;hpb=4ec0190b08c455a89a958545841a796e66051771;p=p5sagit%2Fp5-mst-13.2.git diff --git a/pod/perlvar.pod b/pod/perlvar.pod index 83f4d9c..49cdcb2 100644 --- a/pod/perlvar.pod +++ b/pod/perlvar.pod @@ -619,7 +619,8 @@ across fork() calls. (Mnemonic: same as shells.) =item $< The real uid of this process. (Mnemonic: it's the uid you came I, -if you're running setuid.) +if you're running setuid.) You can change both the real uid and +the effective uid at the same time by using POSIX::setuid(). =item $EFFECTIVE_USER_ID @@ -632,6 +633,9 @@ The effective uid of this process. Example: $< = $>; # set real to effective uid ($<,$>) = ($>,$<); # swap real and effective uid +You can change both the effective uid and the real uid at the same +time by using POSIX::setuid(). + (Mnemonic: it's the uid you went I, if you're running setuid.) C<< $< >> and C<< $> >> can be swapped only on machines supporting setreuid(). @@ -652,6 +656,9 @@ However, a value assigned to C<$(> must be a single number used to 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(). + (Mnemonic: parentheses are used to I things. The real gid is the group you I, if you're running setgid.) @@ -674,6 +681,9 @@ empty list for setgroups(), just repeat the new effective gid; that is, to force an effective gid of 5 and an effectively empty setgroups() 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). + (Mnemonic: parentheses are used to I things. The effective gid is the group that's I for you, if you're running setgid.)