termux-packages/packages/busybox/0012-networking-tftp-no-chroot.patch
Leonid Pliushch ac5daf7925 busybox: update patches
Reorganize patches & do following changes:

 * Enable use of sethostname(2) in utility `hostname`.
 * Enable setting time in utility `date` - busybox already provide own
   implementation of stime(2).

- both features require root.
2019-11-12 02:51:21 +02:00

17 lines
493 B
Diff

diff -uNr busybox-1.31.1/networking/tftp.c busybox-1.31.1.mod/networking/tftp.c
--- busybox-1.31.1/networking/tftp.c 2019-06-10 13:50:53.000000000 +0300
+++ busybox-1.31.1.mod/networking/tftp.c 2019-11-11 22:36:27.592894669 +0200
@@ -907,7 +907,12 @@
G.pw = xgetpwnam(user_opt);
}
if (argv[0]) {
+#ifdef __ANDROID__
+ // chroot may trigger seccomp and is allowed only for root anyway.
+ xchdir(argv[0]);
+#else
xchroot(argv[0]);
+#endif
}
result = recv_from_to(STDIN_FILENO,