1 diff -ruN dropbear-0.46-old/svr-chansession.c dropbear-0.46-new/svr-chansession.c
2 --- dropbear-0.46-old/svr-chansession.c 2005-07-08 21:20:59.000000000 +0200
3 +++ dropbear-0.46-new/svr-chansession.c 2005-07-12 01:39:12.000000000 +0200
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");