summaryrefslogtreecommitdiff
path: root/libexec/rshd/rshd.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/rshd/rshd.c
parent6d199d4d37f161aa59adabfe73b2ce615367fedf (diff)
Deal with _POSIX_SAVED_IDS when relinquishing privileges
Diffstat (limited to 'libexec/rshd/rshd.c')
-rw-r--r--libexec/rshd/rshd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libexec/rshd/rshd.c b/libexec/rshd/rshd.c
index 6b5ca198792..07ada915b2a 100644
--- a/libexec/rshd/rshd.c
+++ b/libexec/rshd/rshd.c
@@ -39,7 +39,7 @@ static char copyright[] =
#ifndef lint
/* from: static char sccsid[] = "@(#)rshd.c 8.2 (Berkeley) 4/6/94"; */
-static char *rcsid = "$Id: rshd.c,v 1.8 1996/11/01 11:30:33 niklas Exp $";
+static char *rcsid = "$Id: rshd.c,v 1.9 1996/12/22 03:41:20 tholo Exp $";
#endif /* not lint */
/*
@@ -660,8 +660,10 @@ fail:
if (setlogin(pwd->pw_name) < 0)
syslog(LOG_ERR, "setlogin() failed: %m");
#endif
+ (void) setegid((gid_t)pwd->pw_gid);
(void) setgid((gid_t)pwd->pw_gid);
initgroups(pwd->pw_name, pwd->pw_gid);
+ (void) seteuid((uid_t)pwd->pw_uid);
(void) setuid((uid_t)pwd->pw_uid);
environ = envinit;
strncat(homedir, pwd->pw_dir, sizeof(homedir)-6);