From: tholo Date: Sun, 22 Dec 1996 03:49:44 +0000 (+0000) Subject: Deal with _POSIX_SAVED_IDS when relinquishing privileges X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2ca35fccd38e1ae517599a10d201e98398ecacb8;p=openbsd Deal with _POSIX_SAVED_IDS when relinquishing privileges --- 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 {