History log of /openbsd/usr.sbin/cron/cron.c (Results 1 – 25 of 82)
Revision Date Author Comments
# 9c847fa8 08-Jul-2022 millert <millert@openbsd.org>

Add a missing check for negative tv_sec when setting the timeout.
Also clear the entire timeout if the remaining time becomes negative
instead of just clearing tv_sec or tv_nsec. OK cheloha@.


# 139e0acf 07-Jul-2022 jca <jca@openbsd.org>

If ppoll(2) exits, log to syslog(3) instead of stderr

By default cron runs as a daemon, with stderr redirected to /dev/null.
Better not exit silently, as spotted by sthen@, danj@, "wxallowed" on
irc

If ppoll(2) exits, log to syslog(3) instead of stderr

By default cron runs as a daemon, with stderr redirected to /dev/null.
Better not exit silently, as spotted by sthen@, danj@, "wxallowed" on
irc/libera and myself. There probably is a bug lurking in ppoll(2)
usage or in the syscall implementation.

ok millert@

show more ...


# be425821 21-Jan-2022 millert <millert@openbsd.org>

Treat ppoll(2) errors as fatal. OK deraadt@


# 2e6cac80 16-Apr-2020 millert <millert@openbsd.org>

Add a mechanism to prevent cron jobs from running concurrently.
This adds a new "-s" flag to the command field which indicates that
only a single instance of the job should run concurrenty.
OK beck@

Add a mechanism to prevent cron jobs from running concurrently.
This adds a new "-s" flag to the command field which indicates that
only a single instance of the job should run concurrenty.
OK beck@ job@ deraadt@

show more ...


# 1ac45bc3 11-Feb-2020 schwarze <schwarze@openbsd.org>

Remove setlocale(3) calls. I checked that no functions are called that
are actually locale-dependent on OpenBSD, and the programs should better
not be locale-dependent even when compiled on other sy

Remove setlocale(3) calls. I checked that no functions are called that
are actually locale-dependent on OpenBSD, and the programs should better
not be locale-dependent even when compiled on other systems.
millert@ points out that the month and weekday names in the fourth and
fifth columns of crontab(5) could in theory be made locale-dependent,
but we certainly don't want that, and currently, they are only compared
against static const char * arrays in entry.c containing English names.
Patch sent in by Jan Stary <hans at stare dot cz>.
OK millert@

show more ...


# 0a66a1fe 23-Oct-2017 jca <jca@openbsd.org>

Close the socket (and dfd) in at(1) child processes

Fixes a failure at restart if a child process still has the socket
opened. Spotted by millert@, ok friehm@ millert@


# a9e807de 07-Jun-2017 millert <millert@openbsd.org>

In cron(8), require that crontab and at files in the spool be owned
by group crontab. The at(1) command now creates files owned by
group crontab, the crontab(1) command already does this.

Files in

In cron(8), require that crontab and at files in the spool be owned
by group crontab. The at(1) command now creates files owned by
group crontab, the crontab(1) command already does this.

Files in the crontab spool with parse errors are now ignored;
crontab(1) will not install a crontab file with parse errors.
The system crontab file (/etc/crontab) is not affected by this.

The required permissions on crontab files have been tightened.
Files in the cron spool must be mode 0600 (as created by crontab(1)).
The system crontab file may be readable/writable by the owner,
readable by group and readable by other. The system crontab must
be readable by the owner.

show more ...


# a100c690 05-Jun-2017 millert <millert@openbsd.org>

Set the group on cron's Unix domain socket _before_ making it
group-writable, not after. Pointed out by Solar Designer.


# 95f2b4e2 11-Jan-2016 millert <millert@openbsd.org>

When caching the mtime of the spool directory and system crontab files,
stash a struct timespec, not just a time_t. Fixes a bug where cron
could skip re-reading the spool after two consecutive chang

When caching the mtime of the spool directory and system crontab files,
stash a struct timespec, not just a time_t. Fixes a bug where cron
could skip re-reading the spool after two consecutive changes.

show more ...


# b8c5c73d 15-Nov-2015 millert <millert@openbsd.org>

Clean up the remaining uses of stderr and perror() and use warn/err
and/or syslog depending on whether stderr is hooked up at the time.
Also remove closelog() which is not needed since we are headed

Clean up the remaining uses of stderr and perror() and use warn/err
and/or syslog depending on whether stderr is hooked up at the time.
Also remove closelog() which is not needed since we are headed for exec.
OK guenther@

show more ...


# 49ff01e1 14-Nov-2015 millert <millert@openbsd.org>

Cleanup from unifdef: set sact.sa_flags to SA_RESTART instead of
clearing it and then ORin in SA_RESTART.


# a38a3395 14-Nov-2015 millert <millert@openbsd.org>

Remove log_it() and call syslog(3) directly using the same format:
"(username) WHAT (details)". Logs due to normal operation (e.g.
crontab operations or running commands) are logged at LOG_INFO like

Remove log_it() and call syslog(3) directly using the same format:
"(username) WHAT (details)". Logs due to normal operation (e.g.
crontab operations or running commands) are logged at LOG_INFO like
before. Actual errors are logged at LOG_ERR, less important things
are logged at LOG_WARNING OR LOG_NOTICE. Also ignore SIGHUP now
that there is no log file to reopen.

show more ...


# 88959323 12-Nov-2015 millert <millert@openbsd.org>

Use absolute paths in pathnames.h. There is no longer a need to
chdir(2) to the cron dir and cron(8) now changes to / via daemon(3).
We no longer try to create/chmod the spool directories as they
sh

Use absolute paths in pathnames.h. There is no longer a need to
chdir(2) to the cron dir and cron(8) now changes to / via daemon(3).
We no longer try to create/chmod the spool directories as they
should be set correctly at install time. The setegid(crontab)
has been moved to open_socket() so it is closer to the chmod(2)
call that needs it. OK deraadt@ tedu@

show more ...


# 6b36bf07 12-Nov-2015 millert <millert@openbsd.org>

Move cron socket to /var/run/cron.sock. Client code will try the old
location if the new one doesn't exist for now. In order to allow
the fchown() to succeed, cron now sets its effective gid to cro

Move cron socket to /var/run/cron.sock. Client code will try the old
location if the new one doesn't exist for now. In order to allow
the fchown() to succeed, cron now sets its effective gid to crontab.
OK jca@ deraadt@

show more ...


# d31b1261 11-Nov-2015 millert <millert@openbsd.org>

Niether cron nor crontab need flock permission.


# e8d6cae4 11-Nov-2015 deraadt <deraadt@openbsd.org>

exit on pledge failure, oops


# 22126b7b 09-Nov-2015 millert <millert@openbsd.org>

Remove unused xpid argument to log_it().


# b75be852 09-Nov-2015 millert <millert@openbsd.org>

Rename AT_DIR -> AT_SPOOL and SPOOL_DIR -> CRON_SPOOL to improve
readability.


# 8a6f8ff3 09-Nov-2015 millert <millert@openbsd.org>

queue(3) instead of homegrown queues and lists. This also fixes
some potential memory leaks in error paths. OK guenther@


# 4a3a0dd4 06-Nov-2015 millert <millert@openbsd.org>

Use __progname instead of the homegrown ProgramName.


# fa575ea2 04-Nov-2015 millert <millert@openbsd.org>

Change cron from including all headers in every file to only including
what each .c file needs. I have not removed cron.h since it will
be used in a future clean up of the cron's .h files. OK nicm@


# 9d64f211 04-Nov-2015 millert <millert@openbsd.org>

Change some globals from extern to static when they are not used
outside their respective .c files. Also remove some unused defines.
OK jung@


# 58a24ea1 31-Oct-2015 millert <millert@openbsd.org>

open_socket() is only used by cron proper so move to cron.c


# 66ca85e4 29-Oct-2015 millert <millert@openbsd.org>

remove unused variables


# 2da949c6 28-Oct-2015 deraadt <deraadt@openbsd.org>

pledge
ok millert


1234