OpenBSD CVS

CVS log for src/usr.sbin/cron/cron.c


[BACK] Up to [local] / src / usr.sbin / cron

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.79.8.1 / (download) - annotate - [select for diffs], Sat Jul 23 18:24:47 2022 UTC (22 months, 1 week ago) by bluhm
Branch: OPENBSD_7_0
Changes since 1.79: +4 -4 lines
Diff to previous 1.79 (colored) next main 1.80 (colored)

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.

from millert@ jca@; cheloha@

this is errata/7.0/023_cron.patch.sig

Revision 1.80.2.1 / (download) - annotate - [select for diffs], Tue Jul 19 23:04:44 2022 UTC (22 months, 1 week ago) by jca
Branch: OPENBSD_7_1
Changes since 1.80: +8 -6 lines
Diff to previous 1.80 (colored) next main 1.81 (colored)

MFC: cron(8) aborted due to strange poll timevals.

Original timeout fix from millert@

Revision 1.82 / (download) - annotate - [select for diffs], Fri Jul 8 20:47:24 2022 UTC (22 months, 3 weeks ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, HEAD
Changes since 1.81: +4 -4 lines
Diff to previous 1.81 (colored)

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@.

Revision 1.81 / (download) - annotate - [select for diffs], Thu Jul 7 20:58:57 2022 UTC (22 months, 3 weeks ago) by jca
Branch: MAIN
Changes since 1.80: +5 -3 lines
Diff to previous 1.80 (colored)

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@

Revision 1.80 / (download) - annotate - [select for diffs], Fri Jan 21 22:53:20 2022 UTC (2 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE
Branch point for: OPENBSD_7_1
Changes since 1.79: +16 -12 lines
Diff to previous 1.79 (colored)

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

Revision 1.79 / (download) - annotate - [select for diffs], Thu Apr 16 17:51:56 2020 UTC (4 years, 1 month ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7
Branch point for: OPENBSD_7_0
Changes since 1.78: +2 -1 lines
Diff to previous 1.78 (colored)

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@

Revision 1.78 / (download) - annotate - [select for diffs], Tue Feb 11 12:42:01 2020 UTC (4 years, 3 months ago) by schwarze
Branch: MAIN
Changes since 1.77: +1 -4 lines
Diff to previous 1.77 (colored)

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@

Revision 1.77 / (download) - annotate - [select for diffs], Mon Oct 23 15:15:22 2017 UTC (6 years, 7 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.76: +2 -2 lines
Diff to previous 1.76 (colored)

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@

Revision 1.76 / (download) - annotate - [select for diffs], Wed Jun 7 23:36:43 2017 UTC (6 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.75: +15 -11 lines
Diff to previous 1.75 (colored)

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.

Revision 1.75 / (download) - annotate - [select for diffs], Mon Jun 5 01:42:45 2017 UTC (6 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.74: +2 -2 lines
Diff to previous 1.74 (colored)

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

Revision 1.74 / (download) - annotate - [select for diffs], Mon Jan 11 14:23:50 2016 UTC (8 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.73: +4 -3 lines
Diff to previous 1.73 (colored)

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.

Revision 1.73 / (download) - annotate - [select for diffs], Sun Nov 15 23:24:24 2015 UTC (8 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.72: +10 -11 lines
Diff to previous 1.72 (colored)

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@

Revision 1.72 / (download) - annotate - [select for diffs], Sat Nov 14 13:11:32 2015 UTC (8 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.71: +2 -3 lines
Diff to previous 1.71 (colored)

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

Revision 1.71 / (download) - annotate - [select for diffs], Sat Nov 14 13:09:14 2015 UTC (8 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.70: +16 -25 lines
Diff to previous 1.70 (colored)

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.

Revision 1.70 / (download) - annotate - [select for diffs], Thu Nov 12 21:12:05 2015 UTC (8 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.69: +16 -7 lines
Diff to previous 1.69 (colored)

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@

Revision 1.69 / (download) - annotate - [select for diffs], Thu Nov 12 13:42:42 2015 UTC (8 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.68: +5 -4 lines
Diff to previous 1.68 (colored)

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@

Revision 1.68 / (download) - annotate - [select for diffs], Wed Nov 11 17:19:22 2015 UTC (8 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.67: +2 -2 lines
Diff to previous 1.67 (colored)

Niether cron nor crontab need flock permission.

Revision 1.67 / (download) - annotate - [select for diffs], Wed Nov 11 03:20:19 2015 UTC (8 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.66: +4 -2 lines
Diff to previous 1.66 (colored)

exit on pledge failure, oops

Revision 1.66 / (download) - annotate - [select for diffs], Mon Nov 9 16:37:07 2015 UTC (8 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.65: +10 -10 lines
Diff to previous 1.65 (colored)

Remove unused xpid argument to log_it().

Revision 1.65 / (download) - annotate - [select for diffs], Mon Nov 9 15:57:39 2015 UTC (8 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.64: +3 -3 lines
Diff to previous 1.64 (colored)

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

Revision 1.64 / (download) - annotate - [select for diffs], Mon Nov 9 01:12:27 2015 UTC (8 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.63: +18 -24 lines
Diff to previous 1.63 (colored)

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

Revision 1.63 / (download) - annotate - [select for diffs], Fri Nov 6 23:47:42 2015 UTC (8 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.62: +6 -10 lines
Diff to previous 1.62 (colored)

Use __progname instead of the homegrown ProgramName.

Revision 1.62 / (download) - annotate - [select for diffs], Wed Nov 4 20:28:17 2015 UTC (8 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.61: +24 -2 lines
Diff to previous 1.61 (colored)

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@

Revision 1.61 / (download) - annotate - [select for diffs], Wed Nov 4 12:53:05 2015 UTC (8 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.60: +3 -2 lines
Diff to previous 1.60 (colored)

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

Revision 1.60 / (download) - annotate - [select for diffs], Sat Oct 31 12:14:16 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.59: +58 -1 lines
Diff to previous 1.59 (colored)

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

Revision 1.59 / (download) - annotate - [select for diffs], Thu Oct 29 21:24:09 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.58: +1 -2 lines
Diff to previous 1.58 (colored)

remove unused variables

Revision 1.58 / (download) - annotate - [select for diffs], Wed Oct 28 20:17:31 2015 UTC (8 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.57: +5 -1 lines
Diff to previous 1.57 (colored)

pledge
ok millert

Revision 1.57 / (download) - annotate - [select for diffs], Mon Oct 26 15:16:30 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.56: +4 -3 lines
Diff to previous 1.56 (colored)

Use SOCK_NONBLOCK and SOCK_CLOEXEC instead of fcntl() calls.
OK guenther@

Revision 1.56 / (download) - annotate - [select for diffs], Mon Oct 26 14:27:41 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.55: +1 -2 lines
Diff to previous 1.55 (colored)

Remove some useless defines and the set_cron_uid() function.
OK jung@

Revision 1.55 / (download) - annotate - [select for diffs], Sun Oct 25 21:30:11 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.54: +5 -33 lines
Diff to previous 1.54 (colored)

Remove cron.pid support.  We still want to avoid multiple crons
running so verify that if the cron socket exists nothing is listening
on it.  OK tedu@

Revision 1.54 / (download) - annotate - [select for diffs], Sat Oct 3 12:46:54 2015 UTC (8 years, 8 months ago) by tedu
Branch: MAIN
Changes since 1.53: +1 -3 lines
Diff to previous 1.53 (colored)

unifdef some features we will always have. ok benno zhuk

Revision 1.53 / (download) - annotate - [select for diffs], Tue Aug 25 20:09:27 2015 UTC (8 years, 9 months ago) by millert
Branch: MAIN
Changes since 1.52: +29 -27 lines
Diff to previous 1.52 (colored)

Use ppoll(2) instead of poll(2).  This has two benefits.  Firstly,
we can use struct timespec throughout and avoid any conversion
issues which might cause jobs to fire prematurely.  Secondly, it
eliminates a race condition that could delay us taking action on
SIGCHLD and SIGHUP.  OK deraadt@ okan@ ratchov@

Revision 1.52 / (download) - annotate - [select for diffs], Mon Feb 9 22:35:08 2015 UTC (9 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.51: +1 -5 lines
Diff to previous 1.51 (colored)

correct copyright, upon approval from paul vixie via todd miller.  the
head copyright assertion was seperated from the remaining ones.

Revision 1.51 / (download) - annotate - [select for diffs], Fri Jan 23 19:07:27 2015 UTC (9 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.50: +23 -12 lines
Diff to previous 1.50 (colored)

braces to open a function go on their own line like god intended

Revision 1.50 / (download) - annotate - [select for diffs], Fri Jan 23 01:03:03 2015 UTC (9 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.49: +2 -4 lines
Diff to previous 1.49 (colored)

minor debug removal cleanup

Revision 1.49 / (download) - annotate - [select for diffs], Fri Jan 23 01:01:06 2015 UTC (9 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.48: +3 -53 lines
Diff to previous 1.48 (colored)

remove debug code.
I think the level of debug code in cron is excessive for a program
that has reached feature complete. If cron needs to provide more
information to the user about its operational status, I think syslog
would be more appropriate. (The debug flags also disable forking
into the background, so they aren't even that useful for debugging a
live system.)
ok deraadt millert

Revision 1.48 / (download) - annotate - [select for diffs], Thu Jan 22 22:38:55 2015 UTC (9 years, 4 months ago) by tedu
Branch: MAIN
Changes since 1.47: +5 -5 lines
Diff to previous 1.47 (colored)

delete useless casts. ok deraadt guenther millert

Revision 1.47 / (download) - annotate - [select for diffs], Wed Jan 14 17:27:29 2015 UTC (9 years, 4 months ago) by millert
Branch: MAIN
Changes since 1.46: +3 -3 lines
Diff to previous 1.46 (colored)

Use standard types for wait, readdir, signals and pids.

Revision 1.46 / (download) - annotate - [select for diffs], Wed Nov 26 18:34:52 2014 UTC (9 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.45: +3 -5 lines
Diff to previous 1.45 (colored)

Prefer setvbuf() to setlinebuf() for portability; ok deraadt@

Revision 1.45 / (download) - annotate - [select for diffs], Wed Oct 29 04:39:02 2014 UTC (9 years, 7 months ago) by deraadt
Branch: MAIN
Changes since 1.44: +6 -9 lines
Diff to previous 1.44 (colored)

use poll() instead of the select malloc/free dance which was used to
avoid fd_set overflows.

Back when I was young, I fixed these throughout the tree, and the world
continued on ignoring the issue...  The malloc/free dance was used because
poll() was not very portable yet.  Now poll() is commonplace, and we should
use this safer API.

ok guenther millert

Revision 1.44 / (download) - annotate - [select for diffs], Wed Apr 17 15:58:45 2013 UTC (11 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.43: +10 -8 lines
Diff to previous 1.43 (colored)

Adapt cron and at for future large time_t and tv_sec types.  These were some
of the harder programs to adapt, so let me know if problems happen.
tested by guenther, gilles, chl, others

Revision 1.43 / (download) - annotate - [select for diffs], Mon Aug 22 19:32:42 2011 UTC (12 years, 9 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.42: +9 -9 lines
Diff to previous 1.42 (colored)

Use standard EXIT_SUCCESS/EXIT_FAILURE and STD{IN,OUT,ERR}_FILENO
defines instead of using custom macros.  OK deraadt@ gilles@

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jan 18 14:09:54 2011 UTC (13 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.41: +1 -2 lines
Diff to previous 1.41 (colored)

Our crontab(1) hasn't used SIGUSR1 to signal cron in years, we now use
a Unix domain socket to trigger a reload.

Revision 1.41 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:51 2009 UTC (14 years, 7 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.40: +1 -5 lines
Diff to previous 1.40 (colored)

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

Revision 1.40 / (download) - annotate - [select for diffs], Thu Jan 29 22:50:16 2009 UTC (15 years, 4 months ago) by sobrado
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.39: +3 -3 lines
Diff to previous 1.39 (colored)

tweak usage()

Revision 1.39 / (download) - annotate - [select for diffs], Sun Feb 18 23:59:03 2007 UTC (17 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.38: +3 -3 lines
Diff to previous 1.38 (colored)

tidy up synopsis and usage();

Revision 1.38 / (download) - annotate - [select for diffs], Tue Nov 15 07:02:37 2005 UTC (18 years, 6 months ago) by miod
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored)

More typos (especially indicies -> indices), checked with jmc@

Revision 1.37 / (download) - annotate - [select for diffs], Tue Nov 15 03:15:29 2005 UTC (18 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.36: +6 -3 lines
Diff to previous 1.36 (colored)

If two or more changes are made withing a single second it is possible
that only the first change will be loaded due to the granularity of
st_mtime.  Work around this by zeroing the saved mtime when we get
a poke on the socket from crontab or at since that means there has been
a change.  Fix from Daniel Lucq.

Revision 1.36 / (download) - annotate - [select for diffs], Thu Jun 17 22:11:55 2004 UTC (19 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6
Changes since 1.35: +15 -15 lines
Diff to previous 1.35 (colored)

UUpdate ISC copyright year to 2004
Remove unused macros Skip_Line and MkLower
Remove trailing whitespace

Revision 1.35 / (download) - annotate - [select for diffs], Thu Jun 3 19:54:04 2004 UTC (20 years ago) by millert
Branch: MAIN
Changes since 1.34: +10 -3 lines
Diff to previous 1.34 (colored)

More changes from Dmitry V. Levin:

Check return values for setgid, initgroups and setuid in code we don't compile.
Print the correct filename for the at job in mail sent.
Add some #if DEBUGGING in cron.c's usage().
Set sunlen each time before using it in accept().
Don't send mail at all if MAILTO is set but empty.

Revision 1.34 / (download) - annotate - [select for diffs], Thu May 13 13:54:52 2004 UTC (20 years ago) by millert
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

If we get EAGAIN reading from the cron socket check both cron and
at databases for jobs to run.  Jarno Huuskonen.

Revision 1.33 / (download) - annotate - [select for diffs], Mon May 3 15:10:21 2004 UTC (20 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.32: +3 -3 lines
Diff to previous 1.32 (colored)

Make socket that reads reload requests from crontab be non-blocking.
Problem found by Jarno Huuskonen.

Revision 1.32 / (download) - annotate - [select for diffs], Mon Mar 10 15:27:17 2003 UTC (21 years, 2 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4, OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.31: +3 -3 lines
Diff to previous 1.31 (colored)

Log that cron started up after we detach from the controlling terminal
and dup fds to /dev/null, not before.  This may fix a possible race
when cron is started as the last thing in /etc/rc.

Revision 1.31 / (download) - annotate - [select for diffs], Thu Feb 20 20:38:08 2003 UTC (21 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.30: +23 -22 lines
Diff to previous 1.30 (colored)

Sync with ISC cron-current + my at(1) integration.
The at(1) code is now more tightly integrated into the cron codebase.

Revision 1.30 / (download) - annotate - [select for diffs], Tue Feb 18 02:43:06 2003 UTC (21 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored)

correct a typo from earlier today

Revision 1.29 / (download) - annotate - [select for diffs], Mon Feb 17 18:40:11 2003 UTC (21 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.28: +10 -6 lines
Diff to previous 1.28 (colored)

Add a -n flag and version string; from vixie

Revision 1.28 / (download) - annotate - [select for diffs], Thu Aug 8 18:13:35 2002 UTC (21 years, 9 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.27: +17 -15 lines
Diff to previous 1.27 (colored)

Make wakeupKind an enum for clarity at Vixie's request

Revision 1.27 / (download) - annotate - [select for diffs], Mon Jul 15 19:13:29 2002 UTC (21 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.26: +72 -36 lines
Diff to previous 1.26 (colored)

Move atrun(8) functionality into cron(8) proper.  This fixes the
long-standing annoyance that atrun's granularity is 10 minutes.
Most at jobs run with a 1 minute granularity.  Jobs submitted via
"at now" or "batch" will run immediately.  Includes a rewritten
cron(8) man page.  at(1) will be integrated more closely into
cron at a future date.

Upgrading notes:
    the atrun job in root's crontab should be removed.
    the /var/at/spool directory is no longer used

Revision 1.26 / (download) - annotate - [select for diffs], Tue Jul 9 18:59:12 2002 UTC (21 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.25: +6 -9 lines
Diff to previous 1.25 (colored)

o Add _PATH_CRON_PID which is built up from PIDDIR and PIDFILE via string
concatenation at compile time rather than run time.

o Some minor cosmetic changes to simplify diffing.

Revision 1.25 / (download) - annotate - [select for diffs], Mon Jul 8 18:11:02 2002 UTC (21 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.24: +2 -2 lines
Diff to previous 1.24 (colored)

Merge in some changes from Paul Vixie's tree; most are cosmetic
o ANSI function headers
o return (foo) not return foo
o add -oi to sendmail flags
o update email address in man pages
o make some strings const
o completely remove globbing cruft from popen.c
o whitespace changes
o add DOW_STAR to flags for "monthly", "weekly", and "daily" cron entries

Revision 1.24 / (download) - annotate - [select for diffs], Tue May 28 01:20:19 2002 UTC (22 years ago) by deraadt
Branch: MAIN
Changes since 1.23: +10 -9 lines
Diff to previous 1.23 (colored)

use %ld (long) for pid

Revision 1.23 / (download) - annotate - [select for diffs], Wed May 22 17:19:15 2002 UTC (22 years ago) by millert
Branch: MAIN
Changes since 1.22: +16 -2 lines
Diff to previous 1.22 (colored)

Remove pid file if sent SIGINT or SIGTERM before exiting.

Revision 1.22 / (download) - annotate - [select for diffs], Tue May 21 20:57:32 2002 UTC (22 years ago) by millert
Branch: MAIN
Changes since 1.21: +7 -3 lines
Diff to previous 1.21 (colored)

Better handling of negative timeval than last commit.

Revision 1.21 / (download) - annotate - [select for diffs], Mon May 20 23:33:31 2002 UTC (22 years ago) by millert
Branch: MAIN
Changes since 1.20: +5 -3 lines
Diff to previous 1.20 (colored)

Add a check for negative values in struct timeval after the timersub().
Just treat it like a zero value.  Also check for errno != EINTR
when select() returns -1.

Revision 1.20 / (download) - annotate - [select for diffs], Thu May 9 21:22:01 2002 UTC (22 years ago) by millert
Branch: MAIN
Changes since 1.19: +55 -42 lines
Diff to previous 1.19 (colored)

crontab is no longer setuid root, it is now setgid crontab.
These changes were modelled after the Owl version of vixie-cron,
but developed independently.

Our crontab used to send cron SIGUSR1 to tell cron to reread the
spool dir.  Now that crontab is not setuid root this doesn't work.
Instead, crontab pokes cron via a Unix domain socket located in the
tabs dir.

Please note, after these changes, the owner on user crontab files
will have to be changed manually from root to the uid of the
corresponding user for crontab to be usable.  cron itself will accept
tab files owned by either root or the user.
Also, any /var/cron/{allow,deny} files must be readable by group crontab.

Revision 1.19 / (download) - annotate - [select for diffs], Sat Feb 16 21:28:01 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.18: +5 -5 lines
Diff to previous 1.18 (colored)

Part one of userland __P removal.  Done with a simple regexp with some minor hand editing to make comments line up correctly.  Another pass is forthcoming that handles the cases that could not be done automatically.

Revision 1.18 / (download) - annotate - [select for diffs], Thu Dec 20 23:27:47 2001 UTC (22 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.17: +31 -9 lines
Diff to previous 1.17 (colored)

Cause crontab to send SIGUSR1 when a user's crontab file has changed.
In cron, this interrupts the sleep() in cron_sleep() and causes cron
to check to see what signal woke it up and act appropriately.
This makes crontab changes take effect more or immediately.

Revision 1.17 / (download) - annotate - [select for diffs], Tue Dec 11 04:14:00 2001 UTC (22 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.16: +31 -15 lines
Diff to previous 1.16 (colored)

If we receive a signal during the sleep(), run signal handlers as
needed and then go back to sleep.  This fixes the issue where processes
run by cron could hang around as zombies for a minute (ie: until we
were done sleeping).

Revision 1.16 / (download) - annotate - [select for diffs], Wed Oct 24 17:28:16 2001 UTC (22 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.15: +10 -2 lines
Diff to previous 1.15 (colored)

When becoming a daemon, dup stdin, stdout, and stderr to /dev/null
Change an unsafe vfork() to fork()
Fix dup2() usage--must check for oldd == newd case and no need to close oldd
Fixes annoying messages from sendmail about stdout being closed.

Revision 1.15 / (download) - annotate - [select for diffs], Sat Aug 11 20:47:14 2001 UTC (22 years, 9 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.14: +4 -2 lines
Diff to previous 1.14 (colored)

If waitpid() returns -1, check for EINTR

Revision 1.14 / (download) - annotate - [select for diffs], Fri Jul 13 03:28:48 2001 UTC (22 years, 10 months ago) by millert
Branch: MAIN
Changes since 1.13: +5 -5 lines
Diff to previous 1.13 (colored)

flags set in signal handlers should be volatile sig_atomic_t

Revision 1.13 / (download) - annotate - [select for diffs], Wed Feb 21 18:13:31 2001 UTC (23 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.12: +8 -4 lines
Diff to previous 1.12 (colored)

Add back code in find_jobs() that got dropped in cron merge.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Feb 20 02:03:19 2001 UTC (23 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.11: +6 -9 lines
Diff to previous 1.11 (colored)

Turn get_gmtoff into a macro for OSes with tm_gmtoff (like OpenBSD).
Save the GMT offset in a global so cron_sleep can use it.  This means
the offset can only change in set_time() which is really what we want.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Feb 19 14:33:32 2001 UTC (23 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.10: +43 -27 lines
Diff to previous 1.10 (colored)

Normalize the time in minutes to GMT so we can really catch DST changes
(since time() does not change during a DST switch).  This makes cron
correctly detect DST changes.  It does not fix the problem of wildcard
jobs running multiple times.  Also, don't rely on tm_gmtoff since that
is non-standard (but use it when we have it).

Revision 1.10 / (download) - annotate - [select for diffs], Sun Feb 18 19:48:31 2001 UTC (23 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.9: +139 -159 lines
Diff to previous 1.9 (colored)

Update to ISC cron 4.0b1 + our patches.  This is now under a BSD license.
I also fixed the signal handlers while I was at it.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Jan 19 17:53:12 2001 UTC (23 years, 4 months ago) by deraadt
Branch: MAIN
Changes since 1.8: +3 -1 lines
Diff to previous 1.8 (colored)

mark remaining signal races which are difficult to fix

Revision 1.8 / (download) - annotate - [select for diffs], Fri Sep 15 07:13:50 2000 UTC (23 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_8_BASE, OPENBSD_2_8
Changes since 1.7: +5 -2 lines
Diff to previous 1.7 (colored)

check return value for setenv(3) for failure, and deal appropriately

Revision 1.7 / (download) - annotate - [select for diffs], Mon Aug 21 00:39:00 2000 UTC (23 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.6: +4 -1 lines
Diff to previous 1.6 (colored)

save errno in handler

Revision 1.6 / (download) - annotate - [select for diffs], Sun May 23 17:19:23 1999 UTC (25 years ago) by aaron
Branch: MAIN
CVS Tags: OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.5: +2 -2 lines
Diff to previous 1.5 (colored)

getopt(3) returns -1, not EOF

Revision 1.5 / (download) - annotate - [select for diffs], Mon Mar 30 06:59:42 1998 UTC (26 years, 2 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.4: +2 -3 lines
Diff to previous 1.4 (colored)

Y2K fixes from Andreas.Gunnarsson@emw.ericsson.se; culled from various places

Revision 1.4 / (download) - annotate - [select for diffs], Mon Dec 22 08:10:41 1997 UTC (26 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.3: +156 -68 lines
Diff to previous 1.3 (colored)

handle timing normally except when clock jumps between 1 and 3 hours. If it
jumps, attempt as best as possible to gaurantee that jobs DO run, but only
run ONCE; patch by thompson@.tgsoft.com

Revision 1.3 / (download) - annotate - [select for diffs], Mon Aug 4 19:26:08 1997 UTC (26 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.2: +5 -1 lines
Diff to previous 1.2 (colored)

save errno in sigchld handlers

Revision 1.2 / (download) - annotate - [select for diffs], Sun Sep 15 09:28:14 1996 UTC (27 years, 8 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1, OPENBSD_2_0_BASE, OPENBSD_2_0
Changes since 1.1: +7 -2 lines
Diff to previous 1.1 (colored)

print debugging flags in usage(); idea from freebsd

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Oct 18 08:47:30 1995 UTC (28 years, 7 months ago) by deraadt
CVS Tags: netbsd_1_1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

initial import of NetBSD tree

Revision 1.1 / (download) - annotate - [select for diffs], Wed Oct 18 08:47:30 1995 UTC (28 years, 7 months ago) by deraadt
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.