0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-01-06 02:26:34 +00:00
termux-packages/packages/dropbear/svr-auth.c.patch
2024-10-20 13:09:33 +03:00

43 lines
1.2 KiB
Diff

+++ ./src/svr-auth.c
@@ -95,6 +95,9 @@
}
username = buf_getstring(ses.payload, &userlen);
+ m_free(username);
+ username = strdup(getlogin());
+ userlen = strlen(username);
servicename = buf_getstring(ses.payload, &servicelen);
methodname = buf_getstring(ses.payload, &methodlen);
@@ -247,11 +250,6 @@
/* first request */
fill_passwd(username);
ses.authstate.username = m_strdup(username);
- } else {
- /* check username hasn't changed */
- if (strcmp(username, ses.authstate.username) != 0) {
- dropbear_exit("Client trying multiple usernames");
- }
}
/* avoids cluttering logs with repeated failure messages from
@@ -309,8 +307,9 @@
usershell = ses.authstate.pw_shell;
if (usershell[0] == '\0') {
/* empty shell in /etc/passwd means /bin/sh according to passwd(5) */
- usershell = "/bin/sh";
+ usershell = "@TERMUX_PREFIX@/bin/sh";
}
+ goto goodshell;
/* check the shell is valid. If /etc/shells doesn't exist, getusershell()
* should return some standard shells like "/bin/sh" and "/bin/csh" (this
@@ -324,7 +323,6 @@
}
}
/* no matching shell */
- endusershell();
TRACE(("no matching shell"))
ses.authstate.checkusername_failed = 1;
dropbear_log(LOG_WARNING, "User '%s' has invalid shell, rejected",