summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Document the "-q " prefix accepted in the "command" field.schwarze2016-10-121-2/+13
| | | | | | Original patch from Wouter Clarie <wclarie at gmail com>, tweaked in joint work with jca@, OK millert@, OK jca@ on an earlier version.
* Fix fd leak on error. OK jsg@millert2016-08-301-8/+10
|
* When caching the mtime of the spool directory and system crontab files,millert2016-01-115-20/+30
| | | | | stash a struct timespec, not just a time_t. Fixes a bug where cron could skip re-reading the spool after two consecutive changes.
* Check pipe(2) return value; noticed by deraadt@millert2015-11-172-5/+10
|
* Check for setgid() failure before executing editor and warn ifmillert2015-11-171-4/+8
| | | | exec of shell + editor fails.
* Clean up the remaining uses of stderr and perror() and use warn/errmillert2015-11-155-108/+128
| | | | | | 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@
* Cleanup from unifdef: set sact.sa_flags to SA_RESTART instead ofmillert2015-11-141-3/+2
| | | | clearing it and then ORin in SA_RESTART.
* Remove log_it() and call syslog(3) directly using the same format:millert2015-11-148-125/+94
| | | | | | | | "(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.
* new location for cron sockets; ok millertjmc2015-11-121-3/+3
|
* Use absolute paths in pathnames.h. There is no longer a need tomillert2015-11-1210-285/+110
| | | | | | | | 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 SIGNALS section now that the non-syslog code has been removed.millert2015-11-121-16/+2
|
* Move cron socket to /var/run/cron.sock. Client code will try the oldmillert2015-11-124-15/+23
| | | | | | 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@
* Use warn/warnx and err/errx. OK jca@millert2015-11-111-102/+62
|
* Niether cron nor crontab need flock permission.millert2015-11-112-4/+4
|
* Remove obsolete utime() call. It predates the use of a socket tomillert2015-11-111-4/+1
| | | | prod cron into checking the spool dir.
* Fix spool dir mode check to avoid extraneous chmod() calls.millert2015-11-111-3/+3
|
* For "crontab -u user -e" change the euid for the mkstemp() callmillert2015-11-111-9/+18
| | | | | instead of calling fchown() after the fact. Fixes a pledge() issue. OK semarie@
* exit on pledge failure, oopsderaadt2015-11-111-2/+4
|
* Remove unused xpid argument to log_it().millert2015-11-098-65/+63
|
* Update CRONDIR comment to reality.millert2015-11-091-4/+5
|
* Rename AT_DIR -> AT_SPOOL and SPOOL_DIR -> CRON_SPOOL to improvemillert2015-11-097-57/+57
| | | | readability.
* Use fstatat() when checking the files in the at queue so wemillert2015-11-091-40/+27
| | | | don't need to chdir to the queue dir. OK guenther@
* queue(3) instead of homegrown queues and lists. This also fixesmillert2015-11-097-170/+130
| | | | some potential memory leaks in error paths. OK guenther@
* Quiet silly clang analyzer warning in calloc() usage.millert2015-11-081-2/+2
|
* Use __progname instead of the homegrown ProgramName.millert2015-11-065-47/+35
|
* Change cron from including all headers in every file to only includingmillert2015-11-0417-89/+251
| | | | | 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@
* Remove unused LogFD variablemillert2015-11-041-6/+1
|
* Change some globals from extern to static when they are not usedmillert2015-11-046-93/+38
| | | | | outside their respective .c files. Also remove some unused defines. OK jung@
* If pledge(2) fails use perror instead of log_it(RealUser, ...) sincemillert2015-11-031-3/+3
| | | | RealUser has not been filled in yet.
* It is only necessary to swap the effective gid when reading a file.millert2015-11-031-33/+1
| | | | | Since we got rid of TMPDIR support there's no need to swap gids when creating or unlinking the temporary file. OK deraadt@
* Use send(MSG_NOSIGNAL) instead of mucking with the disposition of SIGPIPEguenther2015-11-031-4/+2
| | | | ok millert@
* Use setegid() directly instead of swap_gids() / swap_gids_back().millert2015-11-021-33/+25
| | | | OK jca@ nicm@
* Split client-only (at, crontab) functions out of misc.c and intomillert2015-10-314-177/+222
| | | | | client.c. Move truly common functions into common.c. This avoids dead code in the at and crontab commands.
* open_socket() is only used by cron proper so move to cron.cmillert2015-10-313-60/+60
|
* swap_gids and swap_gids_back are only used by crontab.c somillert2015-10-313-16/+15
| | | | move them there.
* Also need exec to run the editor of course.millert2015-10-291-2/+2
|
* crontab needs "proc" for fork(2)millert2015-10-291-2/+2
|
* Use stravis(3) instead of a homegrown vis-like function.millert2015-10-293-61/+9
| | | | OK nicm@
* remove unused variablesmillert2015-10-292-4/+3
|
* Convert env_get() into env_find() similar to __findenv() in libc.millert2015-10-293-67/+51
| | | | | Use env_find() in both env_get() and env_set() to find a var in envp. Remove now-unused strcmp_until() function.
* Remove useless FACILITY define and use LOG_CRON directly.millert2015-10-291-12/+2
| | | | Remove unneeded limits.h include.
* pledgederaadt2015-10-282-2/+12
| | | | ok millert
* Remove TMPDIR support, it is not really useful in crontab.millert2015-10-262-18/+6
| | | | OK deraadt@
* Use SOCK_NONBLOCK and SOCK_CLOEXEC instead of fcntl() calls.millert2015-10-262-19/+6
| | | | OK guenther@
* Remove some useless defines and the set_cron_uid() function.millert2015-10-266-29/+14
| | | | OK jung@
* Remove PIDDIR and PIDFILE missed in previous commit.millert2015-10-251-12/+1
|
* Remove cron.pid support. We still want to avoid multiple cronsmillert2015-10-254-128/+18
| | | | | running so verify that if the cron socket exists nothing is listening on it. OK tedu@
* remove some more ifdef mazinesstedu2015-10-235-71/+5
|
* clear out some more legacy code and whatnottedu2015-10-0612-201/+12
|
* remove stale comment. there is no need to avoid side effects from a "list"tedu2015-10-041-4/+2
| | | | command, because this is not the ftp daemon