termux-packages/packages/busybox/crontab.c.patch
2017-10-15 00:59:29 +02:00

27 lines
830 B
Diff

diff -u -r ../busybox-1.22.1/miscutils/crontab.c ./miscutils/crontab.c
--- ../busybox-1.22.1/miscutils/crontab.c 2014-01-09 19:15:44.000000000 +0100
+++ ./miscutils/crontab.c 2014-07-01 09:47:30.000000000 +0200
@@ -40,10 +40,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");
@@ -168,7 +168,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);