OpenBSD CVS

CVS log for src/usr.sbin/cron/funcs.h


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.30 / (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_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, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, HEAD
Changes since 1.29: +5 -2 lines
Diff to previous 1.29 (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.29 / (download) - annotate - [select for diffs], Mon Feb 5 03:52:37 2018 UTC (6 years, 4 months ago) by millert
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.28: +2 -2 lines
Diff to previous 1.28 (colored)

Pass a FILE * instead of a file descriptor into load_user() and
perform the fclose() in process_crontab().  Previously we were
closing the crontab fd twice--once in load_user() via fclose() and
once in process_crontab().  OK tb@

Revision 1.28 / (download) - annotate - [select for diffs], Sat Nov 14 13:09:14 2015 UTC (8 years, 6 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.27: +1 -3 lines
Diff to previous 1.27 (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.27 / (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.26: +3 -6 lines
Diff to previous 1.26 (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.26 / (download) - annotate - [select for diffs], Mon Nov 9 16:37:07 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

Remove unused xpid argument to log_it().

Revision 1.25 / (download) - annotate - [select for diffs], Mon Nov 9 01:12:27 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.24: +3 -5 lines
Diff to previous 1.24 (colored)

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

Revision 1.24 / (download) - annotate - [select for diffs], Wed Nov 4 12:53:05 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.23: +2 -9 lines
Diff to previous 1.23 (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.23 / (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.22: +1 -2 lines
Diff to previous 1.22 (colored)

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

Revision 1.22 / (download) - annotate - [select for diffs], Sat Oct 31 12:13:01 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.21: +1 -3 lines
Diff to previous 1.21 (colored)

swap_gids and swap_gids_back are only used by crontab.c so
move them there.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Oct 29 22:41:27 2015 UTC (8 years, 7 months ago) by millert
Branch: MAIN
Changes since 1.20: +1 -4 lines
Diff to previous 1.20 (colored)

Use stravis(3) instead of a homegrown vis-like function.
OK nicm@

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

Convert env_get() into env_find() similar to __findenv() in libc.
Use env_find() in both env_get() and env_set() to find a var in envp.
Remove now-unused strcmp_until() function.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Oct 6 14:58:37 2015 UTC (8 years, 8 months ago) by tedu
Branch: MAIN
Changes since 1.18: +1 -4 lines
Diff to previous 1.18 (colored)

clear out some more legacy code and whatnot

Revision 1.18 / (download) - annotate - [select for diffs], Sat Oct 3 19:47:21 2015 UTC (8 years, 8 months ago) by tedu
Branch: MAIN
Changes since 1.17: +3 -3 lines
Diff to previous 1.17 (colored)

There is no need to keep a global array of sysconf(_SC_OPEN_MAX) elements
just to keep track of a single pid. Return it to the caller and make it
their problem.
ok deraadt millert

Revision 1.17 / (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.16: +2 -2 lines
Diff to previous 1.16 (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.16 / (download) - annotate - [select for diffs], Fri Jan 23 01:01:06 2015 UTC (9 years, 4 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.15: +1 -2 lines
Diff to previous 1.15 (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.15 / (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.14: +3 -1 lines
Diff to previous 1.14 (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.14 / (download) - annotate - [select for diffs], Sat Jan 5 16:59:06 2008 UTC (16 years, 5 months ago) by chl
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, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.13: +1 -2 lines
Diff to previous 1.13 (colored)

remove unused function

from tobias@

ok mglocker@ tobias@

Revision 1.13 / (download) - annotate - [select for diffs], Sun Jan 30 20:44:50 2005 UTC (19 years, 4 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.12: +3 -2 lines
Diff to previous 1.12 (colored)

fix some whitespace

Revision 1.12 / (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_6_BASE, OPENBSD_3_6
Changes since 1.11: +9 -9 lines
Diff to previous 1.11 (colored)

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

Revision 1.11 / (download) - annotate - [select for diffs], Thu Jun 26 00:13:38 2003 UTC (20 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.10: +4 -2 lines
Diff to previous 1.10 (colored)

two missing protos

Revision 1.10 / (download) - annotate - [select for diffs], Thu Feb 20 20:38:08 2003 UTC (21 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.9: +2 -1 lines
Diff to previous 1.9 (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.9 / (download) - annotate - [select for diffs], Thu Feb 20 19:12:16 2003 UTC (21 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

If there is no cron.allow or cron.deny file, only the superuser may run
the crontab command; for POSIX compliance.  Create an empty cron.deny
file to allow any user to run crontab:
    install -c -o root -g crontab -m 660 /dev/null /var/cron/cron.deny

Revision 1.8 / (download) - annotate - [select for diffs], Mon Jul 15 19:13:29 2002 UTC (21 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.7: +7 -4 lines
Diff to previous 1.7 (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.7 / (download) - annotate - [select for diffs], Mon Jul 8 18:11:02 2002 UTC (21 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.6: +6 -7 lines
Diff to previous 1.6 (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.6 / (download) - annotate - [select for diffs], Thu May 9 22:15:18 2002 UTC (22 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.5: +3 -2 lines
Diff to previous 1.5 (colored)

prototype open_socket()

Revision 1.5 / (download) - annotate - [select for diffs], Thu May 9 21:22:01 2002 UTC (22 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.4: +3 -3 lines
Diff to previous 1.4 (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.4 / (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.3: +2 -2 lines
Diff to previous 1.3 (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.3 / (download) - annotate - [select for diffs], Tue Feb 20 02:03:19 2001 UTC (23 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.2: +4 -2 lines
Diff to previous 1.2 (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.2 / (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.1: +3 -1 lines
Diff to previous 1.1 (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.1 / (download) - annotate - [select for diffs], Sun Feb 18 19:48:35 2001 UTC (23 years, 3 months ago) by millert
Branch: MAIN

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.

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.