termux-packages/packages/busybox/crond.c.patch

29 lines
874 B
Diff

diff -u -r ../busybox-1.23.1/miscutils/crond.c ./miscutils/crond.c
--- ../busybox-1.23.1/miscutils/crond.c 2015-01-27 03:48:58.000000000 -0500
+++ ./miscutils/crond.c 2015-02-06 16:43:24.238473247 -0500
@@ -415,7 +415,7 @@
maxLines = (strcmp(fileName, "root") == 0) ? 65535 : MAXLINES;
- if (fstat(fileno(parser->fp), &sbuf) == 0 && sbuf.st_uid == DAEMON_UID) {
+ if (fstat(fileno(parser->fp), &sbuf) == 0) {
CronFile *file = xzalloc(sizeof(CronFile));
CronLine **pline;
int n;
@@ -571,6 +571,7 @@
static void set_env_vars(struct passwd *pas, const char *shell)
{
+#ifndef __ANDROID__
/* POSIX requires crond to set up at least HOME, LOGNAME, PATH, SHELL.
* We assume crond inherited suitable PATH.
*/
@@ -585,6 +586,7 @@
xsetenv("HOME", pas->pw_dir);
xsetenv("SHELL", shell);
#endif
+#endif
}
static void change_user(struct passwd *pas)