|
@ -1,7 +1,8 @@ |
|
|
diff -u -r ../openssh-7.7p1/session.c ./session.c
|
|
|
diff --git a/session.c.orig b/session.c
|
|
|
--- ../openssh-7.7p1/session.c 2018-04-02 07:38:28.000000000 +0200
|
|
|
index 58826db..c251ee9 100644
|
|
|
+++ ./session.c 2018-04-03 23:46:30.670337636 +0200
|
|
|
--- a/session.c.orig
|
|
|
@@ -199,7 +199,7 @@
|
|
|
+++ b/session.c
|
|
|
|
|
|
@@ -199,7 +199,7 @@ auth_input_request_forwarding(struct ssh *ssh, struct passwd * pw)
|
|
|
temporarily_use_uid(pw); |
|
|
temporarily_use_uid(pw); |
|
|
|
|
|
|
|
|
/* Allocate a buffer for the socket name, and format the name. */ |
|
|
/* Allocate a buffer for the socket name, and format the name. */ |
|
@ -10,7 +11,7 @@ diff -u -r ../openssh-7.7p1/session.c ./session.c |
|
|
|
|
|
|
|
|
/* Create private directory for socket */ |
|
|
/* Create private directory for socket */ |
|
|
if (mkdtemp(auth_sock_dir) == NULL) { |
|
|
if (mkdtemp(auth_sock_dir) == NULL) { |
|
|
@@ -802,7 +802,7 @@
|
|
|
@@ -802,7 +802,7 @@ do_motd(void)
|
|
|
f = fopen(login_getcapstr(lc, "welcome", "/etc/motd", |
|
|
f = fopen(login_getcapstr(lc, "welcome", "/etc/motd", |
|
|
"/etc/motd"), "r"); |
|
|
"/etc/motd"), "r"); |
|
|
#else |
|
|
#else |
|
@ -19,7 +20,7 @@ diff -u -r ../openssh-7.7p1/session.c ./session.c |
|
|
#endif |
|
|
#endif |
|
|
if (f) { |
|
|
if (f) { |
|
|
while (fgets(buf, sizeof(buf), f)) |
|
|
while (fgets(buf, sizeof(buf), f)) |
|
|
@@ -1044,8 +1044,10 @@
|
|
|
@@ -1044,8 +1044,10 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell)
|
|
|
# endif /* HAVE_CYGWIN */ |
|
|
# endif /* HAVE_CYGWIN */ |
|
|
#endif /* HAVE_LOGIN_CAP */ |
|
|
#endif /* HAVE_LOGIN_CAP */ |
|
|
|
|
|
|
|
@ -30,12 +31,12 @@ diff -u -r ../openssh-7.7p1/session.c ./session.c |
|
|
|
|
|
|
|
|
/* Normal systems set SHELL by default. */ |
|
|
/* Normal systems set SHELL by default. */ |
|
|
child_set_env(&env, &envsize, "SHELL", shell); |
|
|
child_set_env(&env, &envsize, "SHELL", shell); |
|
|
@@ -1053,6 +1055,15 @@
|
|
|
@@ -1053,6 +1055,15 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell)
|
|
|
if (getenv("TZ")) |
|
|
if (getenv("TZ")) |
|
|
child_set_env(&env, &envsize, "TZ", getenv("TZ")); |
|
|
child_set_env(&env, &envsize, "TZ", getenv("TZ")); |
|
|
|
|
|
|
|
|
+#ifdef __ANDROID__
|
|
|
+#ifdef __ANDROID__
|
|
|
+ char const* envs_to_keep[] = {"LD_LIBRARY_PATH", "PATH", "ANDROID_ROOT", "ANDROID_DATA", "EXTERNAL_STORAGE", "LANG", "PREFIX"};
|
|
|
+ char const* envs_to_keep[] = {"LD_LIBRARY_PATH", "PATH", "ANDROID_ROOT", "ANDROID_DATA", "EXTERNAL_STORAGE", "LANG", "PREFIX", "TMPDIR", "PS1"};
|
|
|
+ for (i = 0; i < (sizeof(envs_to_keep) / sizeof(envs_to_keep[0])); i++) {
|
|
|
+ for (i = 0; i < (sizeof(envs_to_keep) / sizeof(envs_to_keep[0])); i++) {
|
|
|
+ char const* env_to_keep_name = envs_to_keep[i];
|
|
|
+ char const* env_to_keep_name = envs_to_keep[i];
|
|
|
+ char const* env_to_keep_value = getenv(env_to_keep_name);
|
|
|
+ char const* env_to_keep_value = getenv(env_to_keep_name);
|
|
|