| 1 | --- ../openssh-6.4p1/session.c 2013-07-20 05:21:53.000000000 +0200 |
| 2 | +++ ./session.c 2014-02-07 00:37:57.000000000 +0100 |
| 3 | @@ -193,7 +193,7 @@ |
| 4 | temporarily_use_uid(pw); |
| 5 | |
| 6 | /* Allocate a buffer for the socket name, and format the name. */ |
| 7 | - auth_sock_dir = xstrdup("/tmp/ssh-XXXXXXXXXX"); |
| 8 | + auth_sock_dir = xstrdup("@TERMUX_PREFIX@/tmp/ssh-XXXXXXXXXX"); |
| 9 | |
| 10 | /* Create private directory for socket */ |
| 11 | if (mkdtemp(auth_sock_dir) == NULL) { |
| 12 | @@ -908,7 +908,7 @@ |
| 13 | f = fopen(login_getcapstr(lc, "welcome", "/etc/motd", |
| 14 | "/etc/motd"), "r"); |
| 15 | #else |
| 16 | - f = fopen("/etc/motd", "r"); |
| 17 | + f = fopen("@TERMUX_PREFIX@/etc/motd", "r"); |
| 18 | #endif |
| 19 | if (f) { |
| 20 | while (fgets(buf, sizeof(buf), f)) |
| 21 | @@ -1125,6 +1125,9 @@ |
| 22 | static char ** |
| 23 | do_setup_env(Session *s, const char *shell) |
| 24 | { |
| 25 | +#ifdef __ANDROID__ |
| 26 | + return environ; |
| 27 | +#else |
| 28 | char buf[256]; |
| 29 | u_int i, envsize; |
| 30 | char **env, *laddr; |
| 31 | @@ -1311,6 +1314,7 @@ |
| 32 | fprintf(stderr, " %.200s\n", env[i]); |
| 33 | } |
| 34 | return env; |
| 35 | +#endif |
| 36 | } |
| 37 | |
| 38 | /* |
| 39 | @@ -1614,7 +1618,9 @@ |
| 40 | * Close any extra file descriptors. Note that there may still be |
| 41 | * descriptors left by system functions. They will be closed later. |
| 42 | */ |
| 43 | +#ifndef __ANDROID__ |
| 44 | endpwent(); |
| 45 | +#endif |
| 46 | |
| 47 | /* |
| 48 | * Close any extra open file descriptors so that we don't have them |