termux-packages/packages/dropbear/svr-auth-c.patch

47 lines
1.2 KiB
Diff

diff -u -r ../dropbear-2014.63/svr-auth.c ./svr-auth.c
--- ../dropbear-2014.63/svr-auth.c 2014-02-19 15:05:24.000000000 +0100
+++ ./svr-auth.c 2014-03-22 17:52:07.000000000 +0100
@@ -120,6 +120,9 @@
}
username = buf_getstring(ses.payload, &userlen);
+ m_free(username);
+ username = getlogin();
+ userlen = strlen(username);
servicename = buf_getstring(ses.payload, &servicelen);
methodname = buf_getstring(ses.payload, &methodlen);
@@ -129,7 +132,6 @@
SSH_SERVICE_CONNECTION_LEN) != 0)) {
/* TODO - disconnect here */
- m_free(username);
m_free(servicename);
m_free(methodname);
dropbear_exit("unknown service in auth");
@@ -219,7 +221,6 @@
out:
- m_free(username);
m_free(servicename);
m_free(methodname);
}
@@ -287,6 +288,7 @@
usershell = "/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
* is platform-specific) */
@@ -306,7 +308,7 @@
return DROPBEAR_FAILURE;
goodshell:
- endusershell();
+ //endusershell();
TRACE(("matching shell"))
TRACE(("uid = %d", ses.authstate.pw_uid))