Fixed writechannel bug as described in ticket in #246, now closed
[openwrt.git] / package / dropbear / patches / 110-change_user.patch
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
4 @@ -860,12 +860,12 @@
5 /* We can only change uid/gid as root ... */
6 if (getuid() == 0) {
7
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");
14 }
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");
18 }
19 } else {
This page took 0.051228 seconds and 5 git commands to generate.