2021-05-04 16:54:33 +02:00
|
|
|
diff -uNr busybox-1.33.1/miscutils/crontab.c busybox-1.33.1.mod/miscutils/crontab.c
|
|
|
|
--- busybox-1.33.1/miscutils/crontab.c 2021-01-01 10:52:27.000000000 +0000
|
|
|
|
+++ busybox-1.33.1.mod/miscutils/crontab.c 2021-05-04 14:17:52.387444315 +0000
|
2020-01-30 13:59:25 +01:00
|
|
|
@@ -51,12 +51,14 @@
|
|
|
|
return;
|
|
|
|
}
|
2015-06-13 01:03:31 +02:00
|
|
|
|
2020-01-30 13:59:25 +01:00
|
|
|
+#ifndef __ANDROID__
|
2015-06-13 01:03:31 +02:00
|
|
|
/* CHILD - change user and run editor */
|
|
|
|
/* initgroups, setgid, setuid */
|
|
|
|
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");
|
2020-01-30 13:59:25 +01:00
|
|
|
@@ -129,7 +131,11 @@
|
|
|
|
if (!argv[0])
|
|
|
|
bb_show_usage();
|
|
|
|
if (NOT_LONE_DASH(argv[0])) {
|
|
|
|
+#ifndef __ANDROID__
|
|
|
|
src_fd = xopen_as_uid_gid(argv[0], O_RDONLY, pas->pw_uid, pas->pw_gid);
|
|
|
|
+#else
|
|
|
|
+ src_fd = xopen3(argv[0], O_RDONLY, 0600);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@@ -158,7 +164,9 @@
|
2020-01-29 22:26:18 +01:00
|
|
|
/* No O_EXCL: we don't want to be stuck if earlier crontabs
|
|
|
|
* were killed, leaving stale temp file behind */
|
|
|
|
src_fd = xopen3(tmp_fname, O_RDWR|O_CREAT|O_TRUNC, 0600);
|
2020-01-30 13:59:25 +01:00
|
|
|
+#ifndef __ANDROID__
|
|
|
|
fchown(src_fd, pas->pw_uid, pas->pw_gid);
|
|
|
|
+#endif
|
2020-01-29 22:26:18 +01:00
|
|
|
fd = open(pas->pw_name, O_RDONLY);
|
|
|
|
if (fd >= 0) {
|
|
|
|
bb_copyfd_eof(fd, src_fd);
|