English Language flag
// Log In
// CVSweb
Project: FreeWRT
// Summary // Activity // Search // Tracker // Lists // News // SCM // Wiki

SCM Repository

ViewVC logotype

Diff of /branches/freewrt_1_0/package/dropbear/patches/110-change_user.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3747 by wbx, Thu Sep 28 10:42:55 2006 UTC revision 3764 by markus, Thu Jun 12 10:50:08 2008 UTC
# Line 1  Line 1 
1  diff -urN dropbear.old/svr-chansession.c dropbear.dev/svr-chansession.c  --- dropbear-0.51/svr-chansession.c.orig        2008-06-12 09:58:01.000000000 +0200
2  --- dropbear.old/svr-chansession.c      2005-12-09 06:42:33.000000000 +0100  +++ dropbear-0.51/svr-chansession.c     2008-06-12 10:04:16.000000000 +0200
3  +++ dropbear.dev/svr-chansession.c      2005-12-12 01:42:38.982034750 +0100  @@ -912,12 +912,12 @@
 @@ -860,12 +860,12 @@  
4          /* We can only change uid/gid as root ... */          /* We can only change uid/gid as root ... */
5          if (getuid() == 0) {          if (getuid() == 0) {
6    
7  -               if ((setgid(ses.authstate.pw->pw_gid) < 0) ||  -               if ((setgid(ses.authstate.pw_gid) < 0) ||
8  +               if ((ses.authstate.pw->pw_gid != 0) && ((setgid(ses.authstate.pw->pw_gid) < 0) ||  +               if ((ses.authstate.pw_gid != 0) && ((setgid(ses.authstate.pw_gid) < 0) ||
9                          (initgroups(ses.authstate.pw->pw_name,                          (initgroups(ses.authstate.pw_name,
10  -                                               ses.authstate.pw->pw_gid) < 0)) {  -                                               ses.authstate.pw_gid) < 0)) {
11  +                                               ses.authstate.pw->pw_gid) < 0))) {  +                                               ses.authstate.pw_gid) < 0))) {
12                          dropbear_exit("error changing user group");                          dropbear_exit("error changing user group");
13                  }                  }
14  -               if (setuid(ses.authstate.pw->pw_uid) < 0) {  -               if (setuid(ses.authstate.pw_uid) < 0) {
15  +               if ((ses.authstate.pw->pw_uid != 0) && (setuid(ses.authstate.pw->pw_uid) < 0)) {  +               if ((ses.authstate.pw_uid != 0) && (setuid(ses.authstate.pw_uid) < 0)) {
16                          dropbear_exit("error changing user");                          dropbear_exit("error changing user");
17                  }                  }
18          } else {          } else {

Legend:
Removed from v.3747  
changed lines
  Added in v.3764

root@freewrt.org:443
ViewVC Help
Powered by ViewVC 1.1.20