summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron/crontab.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* When caching the mtime of the spool directory and system crontab files,millert2016-01-111-1/+2
| | | | | 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 for setgid() failure before executing editor and warn ifmillert2015-11-171-4/+8
| | | | exec of shell + editor fails.
* Remove log_it() and call syslog(3) directly using the same format:millert2015-11-141-10/+13
| | | | | | | | "(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-24/+21
| | | | | | | | 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@
* Use warn/warnx and err/errx. OK jca@millert2015-11-111-102/+62
|
* Niether cron nor crontab need flock permission.millert2015-11-111-2/+2
|
* 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@
* Remove unused xpid argument to log_it().millert2015-11-091-9/+7
|
* Rename AT_DIR -> AT_SPOOL and SPOOL_DIR -> CRON_SPOOL to improvemillert2015-11-091-8/+8
| | | | readability.
* Use __progname instead of the homegrown ProgramName.millert2015-11-061-19/+16
|
* Change cron from including all headers in every file to only includingmillert2015-11-041-7/+23
| | | | | 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@
* 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 setegid() directly instead of swap_gids() / swap_gids_back().millert2015-11-021-33/+25
| | | | OK jca@ nicm@
* swap_gids and swap_gids_back are only used by crontab.c somillert2015-10-311-1/+13
| | | | 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
|
* pledgederaadt2015-10-281-1/+7
| | | | ok millert
* Remove TMPDIR support, it is not really useful in crontab.millert2015-10-261-9/+3
| | | | OK deraadt@
* Remove some useless defines and the set_cron_uid() function.millert2015-10-261-2/+2
| | | | OK jung@
* clear out some more legacy code and whatnottedu2015-10-061-6/+1
|
* correct copyright, upon approval from paul vixie via todd miller. thederaadt2015-02-091-5/+1
| | | | head copyright assertion was seperated from the remaining ones.
* braces to open a function go on their own line like god intendedtedu2015-01-231-11/+21
|
* Remove the OK and ERR macros. They obfuscate the code and don'ttedu2015-01-231-14/+14
| | | | | | | | | help legibility. (unix system calls use 0 for ok, but hundreds of other projects use 1 to indicate success.) Despite the name, many system calls (e.g., open) also return not OK values for success. It also cleans up some weird code like int crontab_fd = OK - 1; This diff is mechanical in nature. Later I will fix the bugs it reveals. ok deraadt
* remove debug code.tedu2015-01-231-15/+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
* Use standard types for wait, readdir, signals and pids.millert2015-01-141-2/+2
|
* Remove compatibility defines for ancient systems. We assume amillert2015-01-141-11/+2
| | | | reasonable level of POSIX compliance.
* Prefer setvbuf() to setlinebuf() for portability; ok deraadt@millert2014-11-261-4/+2
|
* Use standard EXIT_SUCCESS/EXIT_FAILURE and STD{IN,OUT,ERR}_FILENOmillert2011-08-221-31/+31
| | | | defines instead of using custom macros. OK deraadt@ gilles@
* Use futimens() instead of futimes() to avoid converting to/frommillert2011-08-191-12/+6
| | | | struct timeval. OK guenther@
* Fix some possible NULL pointer dereferences, and a little bit of cleanup.phessler2011-05-191-2/+2
| | | | | | From Lawrence Teo (thanks!) OK krw@
* Remove unused variables; from Michael W. Bombardierimillert2011-04-041-3/+2
|
* Make "crontab -l" not crash on crontab files that don't have theguenther2011-02-111-21/+14
| | | | | | | expected three lines of comments. Factor out the "copy a crontab" logic and merge it into ignore_comments(). ok miod@
* Make "crontab -e" honor TMPDIR; from the Openwall project (ldv)millert2011-01-311-4/+43
| | | | OK miod@ jmc@
* using the rcsid is sillyderaadt2009-10-271-4/+2
|
* tweak usage()sobrado2009-01-291-8/+9
|
* from ray@okan2008-05-101-15/+30
| | | | | | | | | - move the ignoring of the top few (3) comments into a function of its own. - ignore these comments for crontab listings. based on a patch from Slava Semushin ok ray@ millert@
* Deal with timespec vs. timeval precision issues. Fixes a problemmillert2007-11-171-3/+7
| | | | | | where the "no changes" case was not properly detected due to timespec supporting nanosec resolution but timeval only supporting microsec resolution. OK deraadt@
* - Be more careful about pre-existing SIGCHLD handlers (or SIG_IGN) byderaadt2007-10-171-13/+10
| | | | | | | | temporarily restoring default behaviour. This is not 100% ideal. But this fixes editor handling in mail... bah, it is really unfortunate that got broken - refactor the restoration code as well, to make it simpler ok ray
* Include err.h and remove unused variables.ray2007-09-011-4/+4
| | | | OK millert.
* Copy editit() from sendbug, synchronizing editor calling code.ray2007-08-311-63/+63
| | | | OK otto, millert, beck, mbalmer, deraadt.
* tidy up synopsis and usage();jmc2007-02-191-3/+3
|
* crontab -e /tmp//crontab.ynUyD24939 versus /tmp/crontab.ynUyD24939.mglocker2007-02-131-3/+3
| | | | OK millert@
* crontab.c uses the rcsid in the crontab head comment so don't protectmillert2005-11-291-4/+2
| | | | it from lint. Found by cloder@
* Detect editors that move the edited file out from underneath us and warn.millert2005-01-301-3/+8
| | | | Based on an idea from Han Boetes.
* Treat EOF at prompt the same as 'n' instead of looping forever.millert2004-11-041-5/+8
| | | | Noticed by mepch@. OK pedro@ and deraadt@
* ftruncate() with ftello() instead of ftell(); ok millertderaadt2004-09-161-3/+3
|
* use snprintf(3) instead of home-grown glue_strings() functionavsm2004-06-221-11/+11
| | | | millert@ ok
* UUpdate ISC copyright year to 2004millert2004-06-171-10/+10
| | | | | Remove unused macros Skip_Line and MkLower Remove trailing whitespace
* Use (char *)NULL instead of (char *)0 in execl and execle; Andrey Matveevmillert2003-07-301-3/+3
|