dash: fix etc/profile hardcoded path (#2357)
[termux-packages] / packages / dropbear / dropbear.patch
1 diff -u -r ../dropbear-2013.62/cli-auth.c ./cli-auth.c
2 --- ../dropbear-2013.62/cli-auth.c 2013-12-03 14:39:15.000000000 +0100
3 +++ ./cli-auth.c 2014-01-05 21:21:37.926812382 +0100
4 @@ -32,6 +32,10 @@
5 #include "packet.h"
6 #include "runopts.h"
7
8 +char * getpass (const char *prompt) {
9 + return "";
10 +}
11 +
12 void cli_authinitialise() {
13
14 memset(&ses.authstate, 0, sizeof(ses.authstate));
15 #ifdef ENABLE_CLI_ANYTCPFWD
16 diff -u -r ../dropbear-2013.62/sshpty.c ./sshpty.c
17 --- ../dropbear-2013.62/sshpty.c 2013-12-03 14:39:15.000000000 +0100
18 +++ ./sshpty.c 2014-01-05 21:21:37.930812382 +0100
19 @@ -22,6 +22,10 @@
20 #include "errno.h"
21 #include "sshpty.h"
22
23 +#ifdef __ANDROID__
24 +# define USE_DEV_PTMX 1
25 +#endif
26 +
27 /* Pty allocated with _getpty gets broken if we do I_PUSH:es to it. */
28 #if defined(HAVE__GETPTY) || defined(HAVE_OPENPTY)
29 #undef HAVE_DEV_PTMX
30 @@ -380,6 +384,7 @@
31 tty_name, strerror(errno));
32 }
33
34 + /*
35 if (st.st_uid != pw->pw_uid || st.st_gid != gid) {
36 if (chown(tty_name, pw->pw_uid, gid) < 0) {
37 if (errno == EROFS &&
38 @@ -409,4 +414,5 @@
39 }
40 }
41 }
42 + */
43 }
44 diff -u -r ../dropbear-2013.62/svr-agentfwd.c ./svr-agentfwd.c
45 --- ../dropbear-2013.62/svr-agentfwd.c 2013-12-03 14:39:15.000000000 +0100
46 +++ ./svr-agentfwd.c 2014-01-05 21:21:37.930812382 +0100
47 @@ -218,10 +218,12 @@
48 /* drop to user privs to make the dir/file */
49 uid = getuid();
50 gid = getgid();
51 + /*
52 if ((setegid(ses.authstate.pw_gid)) < 0 ||
53 (seteuid(ses.authstate.pw_uid)) < 0) {
54 dropbear_exit("Failed to set euid");
55 }
56 + */
57
58 memset((void*)&addr, 0x0, sizeof(addr));
59 addr.sun_family = AF_UNIX;
60 diff -u -r ../dropbear-2013.62/svr-chansession.c ./svr-chansession.c
61 --- ../dropbear-2013.62/svr-chansession.c 2013-12-03 14:39:15.000000000 +0100
62 +++ ./svr-chansession.c 2014-01-05 21:32:15.438797159 +0100
63 @@ -874,6 +874,8 @@
64 #endif
65
66 /* clear environment */
67 + /* termux: do not clear environment on android */
68 +#ifndef __ANDROID__
69 /* if we're debugging using valgrind etc, we need to keep the LD_PRELOAD
70 * etc. This is hazardous, so should only be used for debugging. */
71 #ifndef DEBUG_VALGRIND
72 @@ -886,6 +888,7 @@
73 }
74 #endif /* HAVE_CLEARENV */
75 #endif /* DEBUG_VALGRIND */
76 +#endif /* __ANDROID__ */
77
78 /* We can only change uid/gid as root ... */
79 if (getuid() == 0) {
80 @@ -911,12 +914,14 @@
81 }
82 }
83
84 + /* termux: do not modify environment since we did not clean it */
85 +#ifndef __ANDROID__
86 /* set env vars */
87 addnewvar("USER", ses.authstate.pw_name);
88 addnewvar("LOGNAME", ses.authstate.pw_name);
89 addnewvar("HOME", ses.authstate.pw_dir);
90 addnewvar("SHELL", get_user_shell());
91 - addnewvar("PATH", DEFAULT_PATH);
92 +#endif /* __ANDROID__ */
93 if (chansess->term != NULL) {
94 addnewvar("TERM", chansess->term);
95 }