1 diff -urN dropbear.old/svr-chansession.c dropbear.dev/svr-chansession.c
2 --- dropbear.old/svr-chansession.c 2005-12-09 06:42:33.000000000 +0100
3 +++ dropbear.dev/svr-chansession.c 2005-12-12 01:42:38.982034750 +0100
5 /* We can only change uid/gid as root ... */
8 - if ((setgid(ses.authstate.pw->pw_gid) < 0) ||
9 + if ((ses.authstate.pw->pw_gid != 0) && ((setgid(ses.authstate.pw->pw_gid) < 0) ||
10 (initgroups(ses.authstate.pw->pw_name,
11 - ses.authstate.pw->pw_gid) < 0)) {
12 + ses.authstate.pw->pw_gid) < 0))) {
13 dropbear_exit("error changing user group");
15 - if (setuid(ses.authstate.pw->pw_uid) < 0) {
16 + if ((ses.authstate.pw->pw_uid != 0) && (setuid(ses.authstate.pw->pw_uid) < 0)) {
17 dropbear_exit("error changing user");