summaryrefslogtreecommitdiff
path: root/ext/POSIX/POSIX.xs
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-12-25 21:22:25 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-12-25 21:22:25 +0000
commit13ec70afab644813396652ff23a6e02fbd3d00d7 (patch)
tree1e678823038b2dece5e7fa60f38756e67150e780 /ext/POSIX/POSIX.xs
parent9cdaf1c33e5df64b1c725e058063021ab13fa0af (diff)
downloadperl-13ec70afab644813396652ff23a6e02fbd3d00d7.tar.gz
Fix bug [perl #24641] : when POSIX::set[ug]id() are called,
update the perl variables PL_uid and PL_euid (resp. PL_gid and PL_egid) with the new values. p4raw-id: //depot/perl@21958
Diffstat (limited to 'ext/POSIX/POSIX.xs')
-rw-r--r--ext/POSIX/POSIX.xs10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 049c1b6c63..3b3903828a 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -1827,10 +1827,20 @@ pause()
SysRet
setgid(gid)
Gid_t gid
+ CLEANUP:
+ if (RETVAL >= 0) {
+ PL_gid = getgid();
+ PL_egid = getegid();
+ }
SysRet
setuid(uid)
Uid_t uid
+ CLEANUP:
+ if (RETVAL >= 0) {
+ PL_uid = getuid();
+ PL_euid = geteuid();
+ }
SysRetLong
sysconf(name)