summaryrefslogtreecommitdiff
path: root/libexec/rpc.rwalld/rwalld.c
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-12-22 03:41:25 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-12-22 03:41:25 +0000
commit29b942ca271faf57cf22f4d77c6198d3d9a18795 (patch)
treee78e01431d74ee7d5e7f89285861a5ce132897ca /libexec/rpc.rwalld/rwalld.c
parent6d199d4d37f161aa59adabfe73b2ce615367fedf (diff)
Deal with _POSIX_SAVED_IDS when relinquishing privileges
Diffstat (limited to 'libexec/rpc.rwalld/rwalld.c')
-rw-r--r--libexec/rpc.rwalld/rwalld.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/libexec/rpc.rwalld/rwalld.c b/libexec/rpc.rwalld/rwalld.c
index 1c877a4306c..e0e65892e51 100644
--- a/libexec/rpc.rwalld/rwalld.c
+++ b/libexec/rpc.rwalld/rwalld.c
@@ -28,7 +28,7 @@
*/
#ifndef lint
-static char rcsid[] = "$Id: rwalld.c,v 1.1 1995/10/18 08:43:21 deraadt Exp $";
+static char rcsid[] = "$Id: rwalld.c,v 1.2 1996/12/22 03:41:18 tholo Exp $";
#endif /* not lint */
#include <unistd.h>
@@ -73,10 +73,14 @@ main(argc, argv)
if (geteuid() == 0) {
struct passwd *pep = getpwnam("nobody");
- if (pep)
+ if (pep) {
+ seteuid(pep->pw_uid);
setuid(pep->pw_uid);
- else
+ }
+ else {
+ seteuid(getuid());
setuid(getuid());
+ }
}
/*