mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-15 09:19:57 +00:00
2544e03d10
- update dropbear to latest stable 2024.86;
for the changes see https://matt.ucc.asn.au/dropbear/CHANGES
Link: https://github.com/openwrt/openwrt/pull/17053
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit a9d3c5b4c9
)
Link: https://github.com/openwrt/openwrt/pull/17097
Signed-off-by: Petr Štetiar <ynezz@true.cz>
19 lines
658 B
Diff
19 lines
658 B
Diff
--- a/src/svr-chansession.c
|
|
+++ b/src/svr-chansession.c
|
|
@@ -984,12 +984,12 @@ static void execchild(const void *user_d
|
|
/* We can only change uid/gid as root ... */
|
|
if (getuid() == 0) {
|
|
|
|
- if ((setgid(ses.authstate.pw_gid) < 0) ||
|
|
+ if ((ses.authstate.pw_gid != 0) && ((setgid(ses.authstate.pw_gid) < 0) ||
|
|
(initgroups(ses.authstate.pw_name,
|
|
- ses.authstate.pw_gid) < 0)) {
|
|
+ ses.authstate.pw_gid) < 0))) {
|
|
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");
|
|
}
|
|
} else {
|