Browse Source

openssh: keep TMPDIR and PS1

android-5
Tom Yan 7 years ago
committed by Fredrik Fornwall
parent
commit
a263cc6bc3
  1. 2
      packages/openssh/build.sh
  2. 17
      packages/openssh/session.c.patch

2
packages/openssh/build.sh

@ -1,7 +1,7 @@
TERMUX_PKG_HOMEPAGE=https://www.openssh.com/ TERMUX_PKG_HOMEPAGE=https://www.openssh.com/
TERMUX_PKG_DESCRIPTION="Secure shell for logging into a remote machine" TERMUX_PKG_DESCRIPTION="Secure shell for logging into a remote machine"
TERMUX_PKG_VERSION=7.7p1 TERMUX_PKG_VERSION=7.7p1
TERMUX_PKG_REVISION=1 TERMUX_PKG_REVISION=2
TERMUX_PKG_SHA256=d73be7e684e99efcd024be15a30bffcbe41b012b2f7b3c9084aed621775e6b8f TERMUX_PKG_SHA256=d73be7e684e99efcd024be15a30bffcbe41b012b2f7b3c9084aed621775e6b8f
TERMUX_PKG_SRCURL=https://fastly.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SRCURL=https://fastly.cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_DEPENDS="libandroid-support, ldns, openssl, libedit, libutil" TERMUX_PKG_DEPENDS="libandroid-support, ldns, openssl, libedit, libutil"

17
packages/openssh/session.c.patch

@ -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);

Loading…
Cancel
Save