summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron/funcs.h (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Add a mechanism to prevent cron jobs from running concurrently.millert2020-04-161-2/+5
| | | | | | 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@
* Pass a FILE * instead of a file descriptor into load_user() andmillert2018-02-051-2/+2
| | | | | | 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@
* Remove log_it() and call syslog(3) directly using the same format:millert2015-11-141-3/+1
| | | | | | | | "(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.
* Use absolute paths in pathnames.h. There is no longer a need tomillert2015-11-121-6/+3
| | | | | | | | 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@
* Remove unused xpid argument to log_it().millert2015-11-091-2/+2
|
* queue(3) instead of homegrown queues and lists. This also fixesmillert2015-11-091-5/+3
| | | | some potential memory leaks in error paths. OK guenther@
* Change some globals from extern to static when they are not usedmillert2015-11-041-9/+2
| | | | | outside their respective .c files. Also remove some unused defines. OK jung@
* open_socket() is only used by cron proper so move to cron.cmillert2015-10-311-2/+1
|
* swap_gids and swap_gids_back are only used by crontab.c somillert2015-10-311-3/+1
| | | | move them there.
* Use stravis(3) instead of a homegrown vis-like function.millert2015-10-291-4/+1
| | | | OK nicm@
* Convert env_get() into env_find() similar to __findenv() in libc.millert2015-10-291-2/+1
| | | | | Use env_find() in both env_get() and env_set() to find a var in envp. Remove now-unused strcmp_until() function.
* clear out some more legacy code and whatnottedu2015-10-061-4/+1
|
* There is no need to keep a global array of sysconf(_SC_OPEN_MAX) elementstedu2015-10-031-3/+3
| | | | | | just to keep track of a single pid. Return it to the caller and make it their problem. ok deraadt millert
* Use ppoll(2) instead of poll(2). This has two benefits. Firstly,millert2015-08-251-2/+2
| | | | | | | 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@
* remove debug code.tedu2015-01-231-2/+1
| | | | | | | | | | 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
* Adapt cron and at for future large time_t and tv_sec types. These were somederaadt2013-04-171-1/+3
| | | | | of the harder programs to adapt, so let me know if problems happen. tested by guenther, gilles, chl, others
* remove unused functionchl2008-01-051-2/+1
| | | | | | from tobias@ ok mglocker@ tobias@
* fix some whitespacemillert2005-01-301-2/+3
|
* UUpdate ISC copyright year to 2004millert2004-06-171-9/+9
| | | | | Remove unused macros Skip_Line and MkLower Remove trailing whitespace
* two missing protosderaadt2003-06-261-2/+4
|
* Sync with ISC cron-current + my at(1) integration.millert2003-02-201-1/+2
| | | | The at(1) code is now more tightly integrated into the cron codebase.
* If there is no cron.allow or cron.deny file, only the superuser may runmillert2003-02-201-2/+2
| | | | | | 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
* Move atrun(8) functionality into cron(8) proper. This fixes themillert2002-07-151-4/+7
| | | | | | | | | | | | 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
* Merge in some changes from Paul Vixie's tree; most are cosmeticmillert2002-07-081-7/+6
| | | | | | | | | | | 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
* prototype open_socket()millert2002-05-091-2/+3
|
* crontab is no longer setuid root, it is now setgid crontab.millert2002-05-091-3/+3
| | | | | | | | | | | | | | | | 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.
* 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.millert2002-02-161-2/+2
|
* Turn get_gmtoff into a macro for OSes with tm_gmtoff (like OpenBSD).millert2001-02-201-2/+4
| | | | | 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.
* Normalize the time in minutes to GMT so we can really catch DST changesmillert2001-02-191-1/+3
| | | | | | | (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).
* Update to ISC cron 4.0b1 + our patches. This is now under a BSD license.millert2001-02-181-0/+70
I also fixed the signal handlers while I was at it.