]> andersk Git - openssh.git/blobdiff - sshd.c
- markus@cvs.openbsd.org 2002/06/25 18:51:04
[openssh.git] / sshd.c
diff --git a/sshd.c b/sshd.c
index 18df8ab8f0a0a673922083ce8b8f75e30ff3c585..851fad4be04cb29da8073fdbcadc196d446e7dc9 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.250 2002/06/23 10:29:52 deraadt Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.251 2002/06/25 18:51:04 markus Exp $");
 
 #include <openssl/dh.h>
 #include <openssl/bn.h>
@@ -530,6 +530,7 @@ static void
 privsep_preauth_child(void)
 {
        u_int32_t rand[256];
+       gid_t gidset[2];
        struct passwd *pw;
        int i;
 
@@ -559,7 +560,17 @@ privsep_preauth_child(void)
        /* Drop our privileges */
        debug3("privsep user:group %u:%u", (u_int)pw->pw_uid,
            (u_int)pw->pw_gid);
+#if 0
+       /* XXX not ready, to heavy after chroot */
        do_setusercontext(pw);
+#else
+       gidset[0] = pw->pw_gid;
+       if (setgid(pw->pw_gid) < 0)
+               fatal("setgid failed for %u", pw->pw_gid );
+       if (setgroups(1, gidset) < 0)
+               fatal("setgroups: %.100s", strerror(errno));
+       permanently_set_uid(pw);
+#endif
 }
 
 static Authctxt*
This page took 0.032544 seconds and 4 git commands to generate.