|
@ -1,11 +1,7 @@ |
|
|
Avoid calling setgroups(2). |
|
|
diff -u -r ../openssh-7.7p1/sshd.c ./sshd.c
|
|
|
|
|
|
--- ../openssh-7.7p1/sshd.c 2018-04-02 07:38:28.000000000 +0200
|
|
|
Hardcode and do not require absolute path. |
|
|
+++ ./sshd.c 2018-04-03 23:48:49.605335389 +0200
|
|
|
|
|
|
@@ -553,8 +553,10 @@
|
|
|
diff -u -r ../openssh-7.2p1/sshd.c ./sshd.c
|
|
|
|
|
|
--- ../openssh-7.2p1/sshd.c 2016-02-25 22:40:04.000000000 -0500
|
|
|
|
|
|
+++ ./sshd.c 2016-02-29 02:36:00.863344328 -0500
|
|
|
|
|
|
@@ -644,8 +644,10 @@
|
|
|
|
|
|
debug3("privsep user:group %u:%u", (u_int)privsep_pw->pw_uid, |
|
|
debug3("privsep user:group %u:%u", (u_int)privsep_pw->pw_uid, |
|
|
(u_int)privsep_pw->pw_gid); |
|
|
(u_int)privsep_pw->pw_gid); |
|
|
gidset[0] = privsep_pw->pw_gid; |
|
|
gidset[0] = privsep_pw->pw_gid; |
|
@ -16,17 +12,17 @@ diff -u -r ../openssh-7.2p1/sshd.c ./sshd.c |
|
|
permanently_set_uid(privsep_pw); |
|
|
permanently_set_uid(privsep_pw); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@@ -1487,7 +1489,8 @@
|
|
|
@@ -1447,7 +1449,8 @@
|
|
|
saved_argc = ac; |
|
|
saved_argc = ac; |
|
|
rexec_argc = ac; |
|
|
rexec_argc = ac; |
|
|
saved_argv = xcalloc(ac + 1, sizeof(*saved_argv)); |
|
|
saved_argv = xcalloc(ac + 1, sizeof(*saved_argv)); |
|
|
- for (i = 0; i < ac; i++)
|
|
|
- for (i = 0; (int)i < ac; i++)
|
|
|
+ saved_argv[0] = "@TERMUX_PREFIX@/bin/sshd";
|
|
|
+ saved_argv[0] = "@TERMUX_PREFIX@/bin/sshd";
|
|
|
+ for (i = 1; i < ac; i++)
|
|
|
+ for (i = 1; (int)i < ac; i++)
|
|
|
saved_argv[i] = xstrdup(av[i]); |
|
|
saved_argv[i] = xstrdup(av[i]); |
|
|
saved_argv[i] = NULL; |
|
|
saved_argv[i] = NULL; |
|
|
|
|
|
|
|
|
@@ -1497,8 +1500,10 @@
|
|
|
@@ -1457,8 +1460,10 @@
|
|
|
av = saved_argv; |
|
|
av = saved_argv; |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
@ -37,7 +33,7 @@ diff -u -r ../openssh-7.2p1/sshd.c ./sshd.c |
|
|
|
|
|
|
|
|
/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ |
|
|
/* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ |
|
|
sanitise_stdfd(); |
|
|
sanitise_stdfd(); |
|
|
@@ -1628,8 +1633,6 @@
|
|
|
@@ -1577,8 +1582,6 @@
|
|
|
} |
|
|
} |
|
|
if (rexeced_flag || inetd_flag) |
|
|
if (rexeced_flag || inetd_flag) |
|
|
rexec_flag = 0; |
|
|
rexec_flag = 0; |
|
@ -46,8 +42,8 @@ diff -u -r ../openssh-7.2p1/sshd.c ./sshd.c |
|
|
if (rexeced_flag) |
|
|
if (rexeced_flag) |
|
|
closefrom(REEXEC_MIN_FREE_FD); |
|
|
closefrom(REEXEC_MIN_FREE_FD); |
|
|
else |
|
|
else |
|
|
@@ -1764,7 +1767,9 @@
|
|
|
@@ -1692,7 +1695,9 @@
|
|
|
free(privsep_pw->pw_passwd); |
|
|
freezero(privsep_pw->pw_passwd, strlen(privsep_pw->pw_passwd)); |
|
|
privsep_pw->pw_passwd = xstrdup("*"); |
|
|
privsep_pw->pw_passwd = xstrdup("*"); |
|
|
} |
|
|
} |
|
|
+#ifndef __ANDROID__
|
|
|
+#ifndef __ANDROID__
|
|
@ -56,7 +52,7 @@ diff -u -r ../openssh-7.2p1/sshd.c ./sshd.c |
|
|
|
|
|
|
|
|
/* load host keys */ |
|
|
/* load host keys */ |
|
|
sensitive_data.host_keys = xcalloc(options.num_host_key_files, |
|
|
sensitive_data.host_keys = xcalloc(options.num_host_key_files, |
|
|
@@ -1948,8 +1953,10 @@
|
|
|
@@ -1842,8 +1847,10 @@
|
|
|
* to create a file, and we can't control the code in every |
|
|
* to create a file, and we can't control the code in every |
|
|
* module which might be used). |
|
|
* module which might be used). |
|
|
*/ |
|
|
*/ |
|
@ -66,4 +62,4 @@ diff -u -r ../openssh-7.2p1/sshd.c ./sshd.c |
|
|
+#endif
|
|
|
+#endif
|
|
|
|
|
|
|
|
|
if (rexec_flag) { |
|
|
if (rexec_flag) { |
|
|
rexec_argv = xcalloc(rexec_argc + 2, sizeof(char *)); |
|
|
if (rexec_argc < 0) |
|
|