diff options
author | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-12-22 03:49:46 +0000 |
---|---|---|
committer | Thorsten Lockert <tholo@cvs.openbsd.org> | 1996-12-22 03:49:46 +0000 |
commit | 6a86f2603ce7d567b8878b193485d3d41383548a (patch) | |
tree | 4dcf46f4a238eb4737ac15cb475a91a580ba2858 /gnu/libexec | |
parent | 29b942ca271faf57cf22f4d77c6198d3d9a18795 (diff) |
Deal with _POSIX_SAVED_IDS when relinquishing privileges
Diffstat (limited to 'gnu/libexec')
-rw-r--r-- | gnu/libexec/uucp/libunix/init.c | 8 | ||||
-rw-r--r-- | gnu/libexec/uucp/libunix/spawn.c | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/gnu/libexec/uucp/libunix/init.c b/gnu/libexec/uucp/libunix/init.c index 8a3c416bed1..57a5e77dd40 100644 --- a/gnu/libexec/uucp/libunix/init.c +++ b/gnu/libexec/uucp/libunix/init.c @@ -272,8 +272,10 @@ usysdep_initialize (puuconf,iflags) && geteuid () == 0) { q = getpwnam (OWNER); - if (q != NULL) + if (q != NULL) P + seteuid (q->pw_uid); setuid (q->pw_uid); + } } if ((iflags & INIT_GETCWD) != 0) @@ -371,8 +373,10 @@ usysdep_exit (fsuccess) boolean fsysdep_other_config (z) const char *z; { - (void) setuid (getuid ()); + (void) setegid (getgid ()); (void) setgid (getgid ()); + (void) seteuid (getuid ()); + (void) setuid (getuid ()); return TRUE; } diff --git a/gnu/libexec/uucp/libunix/spawn.c b/gnu/libexec/uucp/libunix/spawn.c index d39e2ba7f49..229616cfa6b 100644 --- a/gnu/libexec/uucp/libunix/spawn.c +++ b/gnu/libexec/uucp/libunix/spawn.c @@ -353,8 +353,10 @@ ixsspawn (pazargs, aidescs, fkeepuid, fkeepenv, zchdir, fnosigs, fshell, if (! fkeepuid) { /* Return to the uid of the invoking user. */ - (void) setuid (getuid ()); + (void) setegid (getgid ()); (void) setgid (getgid ()); + (void) seteuid (getuid ()); + (void) setuid (getuid ()); } else { |