1
1
openwrt/package/network/services/dropbear/patches/110-change_user.patch
Konstantin Demin 99b681934d dropbear: bump to 2026.91
- update dropbear to latest stable 2026.91;
  for the changes see https://matt.ucc.asn.au/dropbear/CHANGES
- cherry-pick upstream patches:
  - sntrup: Fix 64-bit literals
  - Increase MAX_HOSTKEYS to 6
  - Fix too-low pubkey key query count
- automatically refresh patches

Fixes: CVE-2019-6111, CVE-2026-35385
Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/23217
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2026-05-28 01:19:35 +02:00

24 lines
696 B
Diff

--- a/src/svr-auth.c
+++ b/src/svr-auth.c
@@ -504,9 +504,9 @@ void svr_switch_user(void) {
/* 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");
}
@@ -528,7 +528,7 @@ void svr_switch_user(void) {
}
#endif
- 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 {