- cast more returns to void.
- use waitpid instead of wait() to wait for our process, not accidentally
wait for other children.
- return exitstatus only if exited, and return the termination signal otherwise.
in crontab -l.
The problem is that the skip_header code has a side effect of trying to
write to the new temporary cron tab if we run out of comments. Since we
don't have an output file in -l, we core-dump trying to fputc to NULL.
Simplify the logic so that we don't write in the skip_header function,
and we always return the first character after the comment lines to the
caller, skipping the '\n'.
startup time ("reboot" of cron, not the system), so okay_to_go() must
always say they are good to go. Otherwise they never will. All other
meta-timetags pertain to regular times, so they are (or were)
unaffected.
Problem noted by tron and successfully assigned to me by perry.
I simplified the patch addressed certain security concerns. I only
allowed setusercontext() to set resource limits/priority and umask,
because these are the values that are relevant from login.conf. The
rest of the settings (uid/gid/initgroups) should be done using e->uid
and e->gid like they were before, not from:
struct passwd *pwd = getpwnam(getenv("LOGNAME"));
Finally login_cap's (path/env) are irrelevant in this context since
we want to use our e->envp anyway to execute the command.
for the system crontab file, pass a NULL pointer instead. This
prevents someone from creating a "*system*" file in the tabs directory
that acts as an alternate root crontab.
from openbsd
execution. CRON_TZ sets the time zone within which a job is
considered for execution (but not in which it runs), and CRON_WITHIN
allows jobs to be skipped whose execution is delayed for any reason
(eg, the system was sleeping or the load average is too high for
timely execution).
ended up _after_ the final '\0', so the code past though there are some
data to be passed to the spawned command, causing child process
crash under some circumstances; adjust input_data in this case to avoid this
XXX this is already fixed in cron 4.0-b1 (though slighly differently)