summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2003-06-02 19:09:48 +1000
committerDamien Miller <djm@mindrot.org>2003-06-02 19:09:48 +1000
commit61d3680acab4704db04b94983d0bc3ac1fbecd84 (patch)
tree2a70047a2b6d64590c11c6321952cbe9cde1208f /sshd.c
parentab2db41b6173565461b73f48e97d94ffe0ab9353 (diff)
- deraadt@cvs.openbsd.org 2003/05/29 16:58:45
[sshd.c uidswap.c] seteuid and setegid; markus ok
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sshd.c b/sshd.c
index 8226d9578..e73135c7b 100644
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
42 */ 42 */
43 43
44#include "includes.h" 44#include "includes.h"
45RCSID("$OpenBSD: sshd.c,v 1.266 2003/05/24 09:30:40 djm Exp $"); 45RCSID("$OpenBSD: sshd.c,v 1.267 2003/05/29 16:58:45 deraadt Exp $");
46 46
47#include <openssl/dh.h> 47#include <openssl/dh.h>
48#include <openssl/bn.h> 48#include <openssl/bn.h>
@@ -564,8 +564,10 @@ privsep_preauth_child(void)
564 do_setusercontext(pw); 564 do_setusercontext(pw);
565#else 565#else
566 gidset[0] = pw->pw_gid; 566 gidset[0] = pw->pw_gid;
567 if (setegid(pw->pw_gid) < 0)
568 fatal("setegid failed for %u", (u_int)pw->pw_gid);
567 if (setgid(pw->pw_gid) < 0) 569 if (setgid(pw->pw_gid) < 0)
568 fatal("setgid failed for %u", (u_int)pw->pw_gid ); 570 fatal("setgid failed for %u", (u_int)pw->pw_gid);
569 if (setgroups(1, gidset) < 0) 571 if (setgroups(1, gidset) < 0)
570 fatal("setgroups: %.100s", strerror(errno)); 572 fatal("setgroups: %.100s", strerror(errno));
571 permanently_set_uid(pw); 573 permanently_set_uid(pw);