changeset 204:675f7bf3c391

Seperate out exit errors from setgid()/initgroups(), and errors from setuid(), to make debugging a bit easier
author Matt Johnston <matt@ucc.asn.au>
date Fri, 27 May 2005 16:34:57 +0000
parents ca6a7c7a925c
children 3924393e2456 0d56e4b80dfb
files svr-chansession.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/svr-chansession.c	Mon May 09 09:31:49 2005 +0000
+++ b/svr-chansession.c	Fri May 27 16:34:57 2005 +0000
@@ -862,8 +862,10 @@
 
 		if ((setgid(ses.authstate.pw->pw_gid) < 0) ||
 			(initgroups(ses.authstate.pw->pw_name, 
-						ses.authstate.pw->pw_gid) < 0) ||
-			(setuid(ses.authstate.pw->pw_uid) < 0)) {
+						ses.authstate.pw->pw_gid) < 0)) {
+			dropbear_exit("error changing user group");
+		}
+		if (setuid(ses.authstate.pw->pw_uid) < 0) {
 			dropbear_exit("error changing user");
 		}
 	} else {