diff options
Diffstat (limited to 'pod')
-rw-r--r-- | pod/perlvar.pod | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/pod/perlvar.pod b/pod/perlvar.pod index 83f4d9cd9e..49cdcb273e 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<from>, -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<to>, 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<not> 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<group> things. The real gid is the group you I<left>, 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<group> things. The effective gid is the group that's I<right> for you, if you're running setgid.) |