X-Git-Url: https://git.rohieb.name/openwrt.git/blobdiff_plain/610000bfd938ef14565ef9a8e27fbdd43dc6c1cb..e0b1d7ab2557dfc6924628a521a6757e9ef19247:/package/dropbear/patches/110-change_user.patch diff --git a/package/dropbear/patches/110-change_user.patch b/package/dropbear/patches/110-change_user.patch index 4a0cdc5e7..f003c276c 100644 --- a/package/dropbear/patches/110-change_user.patch +++ b/package/dropbear/patches/110-change_user.patch @@ -1,8 +1,6 @@ -Index: dropbear-0.51/svr-chansession.c -=================================================================== ---- dropbear-0.51.orig/svr-chansession.c 2008-04-22 17:29:49.000000000 -0700 -+++ dropbear-0.51/svr-chansession.c 2008-04-22 17:29:49.000000000 -0700 -@@ -912,12 +912,12 @@ +--- a/svr-chansession.c ++++ b/svr-chansession.c +@@ -881,12 +881,12 @@ static void execchild(void *user_data) { /* We can only change uid/gid as root ... */ if (getuid() == 0) { @@ -11,10 +9,10 @@ Index: dropbear-0.51/svr-chansession.c (initgroups(ses.authstate.pw_name, - ses.authstate.pw_gid) < 0)) { + ses.authstate.pw_gid) < 0))) { - dropbear_exit("error changing user group"); + dropbear_exit("Error changing user group"); } - if (setuid(ses.authstate.pw_uid) < 0) { + if ((ses.authstate.pw_uid != 0) && (setuid(ses.authstate.pw_uid) < 0)) { - dropbear_exit("error changing user"); + dropbear_exit("Error changing user"); } } else {