diff options
author | Garry T. Williams <garry@zvolve.com> | 2000-09-04 08:09:44 -0400 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-11-01 20:56:34 +0000 |
commit | a043a68546f5b73797216edaeee5d9ddb364c19a (patch) | |
tree | 1adac73aaa089abb5b9dffc4afb47c6994909b03 /ext/POSIX/POSIX.xs | |
parent | e093bcf0cf7ac8078690b5226007992e026a34d0 (diff) | |
download | perl-a043a68546f5b73797216edaeee5d9ddb364c19a.tar.gz |
Make the POSIX::setuid and POSIX::setgid to really call setuid()
and setgid() because they were just changing $< and $( which means
only changing the real uid/gid, as opposed to changing both
real and effective ids. (The alternative way could have been
in POSIX.pm to change $> and $), too, but making a direct call
to the C API feels cleaner.) Fixes the bug
Subject: [ID 20000904.005] POSIX::setuid() Doesn't Call setuid()
Message-Id: <200009041609.e84G9iN12155@ifr.inside.zvolve.net>
p4raw-id: //depot/perl@7521
Diffstat (limited to 'ext/POSIX/POSIX.xs')
-rw-r--r-- | ext/POSIX/POSIX.xs | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index a536671afc..c5d169a9f2 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -65,7 +65,7 @@ # include <lib$routines.h> /* prototype for lib$ediv() */ # include <starlet.h> /* prototype for sys$gettim() */ # if DECC_VERSION < 50000000 -# define pid_t int /* old versions of DECC miss this in types.h */ +# define Pid_t int /* old versions of DECC miss this in types.h */ # endif # undef mkfifo @@ -117,7 +117,7 @@ # define mkfifo(a,b) not_here("mkfifo") # define ttyname(a) (char*)not_here("ttyname") # define sigset_t long -# define pid_t long +# define Pid_t long # ifdef __BORLANDC__ # define tzname _tzname # endif @@ -3545,20 +3545,20 @@ read(fd, buffer, nbytes) SysRet setpgid(pid, pgid) - pid_t pid - pid_t pgid + Pid_t pid + Pid_t pgid -pid_t +Pid_t setsid() -pid_t +Pid_t tcgetpgrp(fd) int fd SysRet tcsetpgrp(fd, pgrp_id) int fd - pid_t pgrp_id + Pid_t pgrp_id int uname() @@ -3940,6 +3940,14 @@ pathconf(filename, name) SysRet pause() +SysRet +setgid(gid) + Gid_t gid + +SysRet +setuid(uid) + Uid_t uid + SysRetLong sysconf(name) int name @@ -3947,3 +3955,5 @@ sysconf(name) char * ttyname(fd) int fd + + |