termux-packages/packages/busybox/0008-miscutils-crontab.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

27 lines
845 B
Diff

diff -uNr busybox-1.31.1/miscutils/crontab.c busybox-1.31.1.mod/miscutils/crontab.c
--- busybox-1.31.1/miscutils/crontab.c 2019-06-10 13:50:53.000000000 +0300
+++ busybox-1.31.1.mod/miscutils/crontab.c 2019-11-11 22:08:19.115118798 +0200
@@ -53,10 +53,12 @@
/* CHILD - change user and run editor */
/* initgroups, setgid, setuid */
+#ifndef __ANDROID__
change_identity(pas);
setup_environment(pas->pw_shell,
SETUP_ENV_CHANGEENV | SETUP_ENV_TO_TMP,
pas);
+#endif
ptr = getenv("VISUAL");
if (!ptr) {
ptr = getenv("EDITOR");
@@ -167,7 +169,8 @@
}
close_on_exec_on(src_fd); /* don't want editor to see this fd */
edit_file(pas, tmp_fname);
- /* fall through */
+ xrename(tmp_fname, pas->pw_name);
+ break;
case 0: /* Replace (no -l, -e, or -r were given) */
new_fname = xasprintf("%s.new", pas->pw_name);