diff svr-chansession.c @ 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 161557a9dde8
children 1a52846ec11f
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 {