source: freewrt/package/dropbear/patches/110-change_user.patch@ 166beac

freewrt_1_0 freewrt_2_0
Last change on this file since 166beac was 166beac, checked in by Markus Wigge <markus@…>, 17 years ago

reverted the patches somone removed ... and fixed them

git-svn-id: svn://www.freewrt.org/branches/freewrt_1_0@3764 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100644
File size: 710 bytes
  • dropbear-0.51/svr-chansession.c

    old new  
    912912        /* We can only change uid/gid as root ... */
    913913        if (getuid() == 0) {
    914914
    915                 if ((setgid(ses.authstate.pw_gid) < 0) ||
     915                if ((ses.authstate.pw_gid != 0) && ((setgid(ses.authstate.pw_gid) < 0) ||
    916916                        (initgroups(ses.authstate.pw_name,
    917                                                 ses.authstate.pw_gid) < 0)) {
     917                                                ses.authstate.pw_gid) < 0))) {
    918918                        dropbear_exit("error changing user group");
    919919                }
    920                 if (setuid(ses.authstate.pw_uid) < 0) {
     920                if ((ses.authstate.pw_uid != 0) && (setuid(ses.authstate.pw_uid) < 0)) {
    921921                        dropbear_exit("error changing user");
    922922                }
    923923        } else {
Note: See TracBrowser for help on using the repository browser.