source: branches/backfire/package/dropbear/patches/110-change_user.patch @ 27817

Last change on this file since 27817 was 27817, checked in by jow, 5 years ago

[backfire] sync dropbear with trunk (#9819)

  • Property svn:eol-style set to native
File size: 650 bytes
  • svr-chansession.c

    a b static void execchild(void *user_data) { 
    881881        /* We can only change uid/gid as root ... */ 
    882882        if (getuid() == 0) { 
    883883 
    884                 if ((setgid(ses.authstate.pw_gid) < 0) || 
     884                if ((ses.authstate.pw_gid != 0) && ((setgid(ses.authstate.pw_gid) < 0) || 
    885885                        (initgroups(ses.authstate.pw_name,  
    886                                                 ses.authstate.pw_gid) < 0)) { 
     886                                                ses.authstate.pw_gid) < 0))) { 
    887887                        dropbear_exit("Error changing user group"); 
    888888                } 
    889                 if (setuid(ses.authstate.pw_uid) < 0) { 
     889                if ((ses.authstate.pw_uid != 0) && (setuid(ses.authstate.pw_uid) < 0)) { 
    890890                        dropbear_exit("Error changing user"); 
    891891                } 
    892892        } else { 
Note: See TracBrowser for help on using the repository browser.