const char *log_filename;
const char *crontab_dir_name; /* = CRONTABS; */
CronFile *cron_files;
+ char *default_shell;
#if SETENV_LEAKS
char *env_var_user;
char *env_var_home;
goto err;
}
- shell = line->cl_shell ? line->cl_shell : DEFAULT_SHELL;
+ shell = line->cl_shell ? line->cl_shell : G.default_shell;
prog = run_sendmail ? SENDMAIL : shell;
set_env_vars(pas, shell);
}
/* Prepare things before vfork */
- shell = line->cl_shell ? line->cl_shell : DEFAULT_SHELL;
+ shell = line->cl_shell ? line->cl_shell : G.default_shell;
set_env_vars(pas, shell);
/* Fork as the user in question and run program */
reopen_logfile_to_stderr();
xchdir(G.crontab_dir_name);
+ /* $SHELL, or current UID's shell, or DEFAULT_SHELL */
+ /* Useful on Android where DEFAULT_SHELL /bin/sh may not exist */
+ G.default_shell = xstrdup(get_shell_name());
+
log8("crond (busybox "BB_VER") started, log level %d", G.log_level);
rescan_crontab_dir();
write_pidfile(CONFIG_PID_FILE_PATH "/crond.pid");