summaryrefslogtreecommitdiff
path: root/usr.bin/ssh/sshd.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-05-29 16:58:46 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-05-29 16:58:46 +0000
commit574eb06e52df64db068d870c4035ec890dc3a1bd (patch)
tree629f7bdd914232995f04a7cb39b362fae302d62c /usr.bin/ssh/sshd.c
parent4f46bcfdf7afda31f83bcebae5b199a9b048b883 (diff)
seteuid and setegid; markus ok
Diffstat (limited to 'usr.bin/ssh/sshd.c')
-rw-r--r--usr.bin/ssh/sshd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c
index 5839276e34b..7fbceffffdc 100644
--- a/usr.bin/ssh/sshd.c
+++ b/usr.bin/ssh/sshd.c
@@ -42,7 +42,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.266 2003/05/24 09:30:40 djm Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.267 2003/05/29 16:58:45 deraadt Exp $");
#include <openssl/dh.h>
#include <openssl/bn.h>
@@ -555,8 +555,10 @@ privsep_preauth_child(void)
do_setusercontext(pw);
#else
gidset[0] = pw->pw_gid;
+ if (setegid(pw->pw_gid) < 0)
+ fatal("setegid failed for %u", (u_int)pw->pw_gid);
if (setgid(pw->pw_gid) < 0)
- fatal("setgid failed for %u", (u_int)pw->pw_gid );
+ fatal("setgid failed for %u", (u_int)pw->pw_gid);
if (setgroups(1, gidset) < 0)
fatal("setgroups: %.100s", strerror(errno));
permanently_set_uid(pw);