add base-files change from whiterussian
[openwrt.git] / openwrt / package / dropbear / patches / change-user.patch
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
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.043827 seconds and 5 git commands to generate.