1 diff -u -r ../openssh-7.7p1/sshd.c ./sshd.c
2 --- ../openssh-7.7p1/sshd.c 2018-04-02 07:38:28.000000000 +0200
3 +++ ./sshd.c 2018-04-03 23:48:49.605335389 +0200
5 debug3("privsep user:group %u:%u", (u_int)privsep_pw->pw_uid,
6 (u_int)privsep_pw->pw_gid);
7 gidset[0] = privsep_pw->pw_gid;
9 if (setgroups(1, gidset) < 0)
10 fatal("setgroups: %.100s", strerror(errno));
12 permanently_set_uid(privsep_pw);
18 saved_argv = xcalloc(ac + 1, sizeof(*saved_argv));
19 - for (i = 0; (int)i < ac; i++)
20 + saved_argv[0] = "@TERMUX_PREFIX@/bin/sshd";
21 + for (i = 1; (int)i < ac; i++)
22 saved_argv[i] = xstrdup(av[i]);
25 @@ -1457,8 +1460,10 @@
30 if (geteuid() == 0 && setgroups(0, NULL) == -1)
31 debug("setgroups(): %.200s", strerror(errno));
34 /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */
38 if (rexeced_flag || inetd_flag)
40 - if (!test_flag && (rexec_flag && (av[0] == NULL || *av[0] != '/')))
41 - fatal("sshd re-exec requires execution with an absolute path");
43 closefrom(REEXEC_MIN_FREE_FD);
46 freezero(privsep_pw->pw_passwd, strlen(privsep_pw->pw_passwd));
47 privsep_pw->pw_passwd = xstrdup("*");
54 sensitive_data.host_keys = xcalloc(options.num_host_key_files,
55 @@ -1842,8 +1847,10 @@
56 * to create a file, and we can't control the code in every
57 * module which might be used).
60 if (setgroups(0, NULL) < 0)
61 debug("setgroups() failed: %.200s", strerror(errno));