You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.4 KiB
51 lines
1.4 KiB
7 years ago
|
diff -uNr dropbear-2018.76/svr-auth.c dropbear-2018.76.mod/svr-auth.c
|
||
|
--- dropbear-2018.76/svr-auth.c 2018-02-27 16:25:12.000000000 +0200
|
||
|
+++ dropbear-2018.76.mod/svr-auth.c 2018-04-21 13:48:35.083741369 +0300
|
||
|
@@ -93,6 +93,9 @@
|
||
10 years ago
|
}
|
||
|
|
||
|
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);
|
||
|
|
||
7 years ago
|
@@ -102,7 +105,6 @@
|
||
10 years ago
|
SSH_SERVICE_CONNECTION_LEN) != 0)) {
|
||
|
|
||
|
/* TODO - disconnect here */
|
||
|
- m_free(username);
|
||
|
m_free(servicename);
|
||
|
m_free(methodname);
|
||
|
dropbear_exit("unknown service in auth");
|
||
7 years ago
|
@@ -192,7 +194,6 @@
|
||
10 years ago
|
|
||
|
out:
|
||
|
|
||
|
- m_free(username);
|
||
|
m_free(servicename);
|
||
|
m_free(methodname);
|
||
|
}
|
||
7 years ago
|
@@ -320,9 +321,10 @@
|
||
|
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";
|
||
10 years ago
|
}
|
||
|
|
||
|
+ 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) */
|
||
7 years ago
|
@@ -343,7 +345,7 @@
|
||
10 years ago
|
return DROPBEAR_FAILURE;
|
||
|
|
||
|
goodshell:
|
||
|
- endusershell();
|
||
|
+ //endusershell();
|
||
|
TRACE(("matching shell"))
|
||
|
|
||
|
TRACE(("uid = %d", ses.authstate.pw_uid))
|