Commit Graph

60 Commits

Author SHA1 Message Date
christos fe40cc2899 explain CRON_WITHIN better. 2022-02-26 17:02:47 +00:00
christos cd11565244 Add -s (SINGLE_JOB) from OpenBSD. 2020-04-18 19:32:19 +00:00
pgoyette 4e06cde223 Move the range example (for 8-11) to follow the range definition, and to
preceed the random (?) discussion (and the corresponding random example)
2020-04-17 19:42:14 +00:00
christos 685ba05b53 Put back the ? syntax accidentally removed when syncing with the OpenBSD
man page.
2020-04-17 18:39:31 +00:00
christos 558326f791 PR/54433: Hisashi Todd Fujinaka: Empty $MAILTO causes cron to crash 2019-08-03 07:06:47 +00:00
kre 7801b53db3 Add some more "crappy error detection" - the low value of
the range of random_with_range() must not be negative (or now
we are doing unsigned modulus we might generate a very big result).
2018-07-28 13:55:08 +00:00
kre 8650a842fd Fix from Michael Kaufmann in PR bin/53476
Do modulus using unsigned arith, and then convert the result to
int, rather than converting the arc4random() result to int (which
might be negative) and performing a modulus on that (with a
potentially negative answer).
2018-07-28 13:51:26 +00:00
wiz 20caeb0eac Fix Dd argument. Remove unnecessary whitespace. 2018-06-15 23:15:56 +00:00
christos fdf2ea1385 Add -n (don't send mail if command exited normally) option. From OpenBSD via
Job Snidjers.
2018-06-14 22:04:28 +00:00
christos 4911152229 Replace with the OpenBSD man page. It removes some historical comparisons
that are not very useful (and trully if any they belong to a separate section
instead of being interspersed in the document), and organizes and formats
the information better.
2018-06-14 22:02:57 +00:00
htodd ea01913fc3 Fix typo in function name. 2018-03-06 21:21:27 +00:00
christos bdb24028e2 split out the child runner. 2018-02-04 03:37:59 +00:00
christos 3b612085a8 Remove debugging log statement 2017-09-28 02:32:51 +00:00
christos 7e10eace88 Factor out the read and write data code from the huge child_process function.
When we create a pipe to read data, restore the sigchld signal handler since
pclose expects to wait for the child (to avoid spurious error reporting later).
2017-09-25 08:30:46 +00:00
christos 28e539bcbb - since we use log_it for cron_pclose() use log_it for cron_popen() too
so we can see the reason it failed.
- add log_itx() that takes a format and use it.
- simplify with asprintf()
2017-08-17 08:53:00 +00:00
joerg ba06b608b5 Do not partially initialize a static variable. 2017-06-11 20:38:17 +00:00
christos 065057e635 Apply selected patches from OpenWall:
http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/vixie-cron/

1. Add PAM support.
2. Sanitize children process reaping
3. futimens when we have an fd
4. close_all for crontab(8)
5. use a table for spool dirs instead of duplicating code.
6. handle errors from process_exit()
7. Add ENABLE_FIX_DIRECTORIES ifdef and enable it by default for compat
8. Avoid using fd's < STDERR

Not applied:
1. no xfork (no setresuid)
2. did not do the lstat before open.
3. did not enable cron group
2017-06-09 17:36:29 +00:00
christos cc31744fc2 I am having the last_word: Print the full hostname. 2015-12-17 22:36:48 +00:00
christos bc0d7f41c8 fix type 2015-11-20 23:43:52 +00:00
joerg 0b40943b07 bail is dead. 2015-01-04 18:45:17 +00:00
christos 2ef06139f8 - Don't allow bypassing file size limits with crontabs from stdin.
- Allow signals while reading the user crontab file; doing "crontab -"
  does not let you abort otherwise, and doing ^Z, kill %1 leaves turds
  in /var/cron/tabs
2014-12-15 16:45:26 +00:00
tron 7edfdcc221 Make crontab(1) work again which got broken by the last commit. 2014-09-07 13:35:27 +00:00
joerg 5f34e14bbb Mark usage and quit as dead. 2014-09-07 13:34:12 +00:00
christos 734041fc2a store lastch to an int so that EOF is handled properly. 2014-09-06 12:18:49 +00:00
christos ae5dea0a14 WARNS=6 2014-09-05 21:32:37 +00:00
christos f8739668ae Rewind the file before we install it so that we can check it.
Before this fix, no checks were made and you could install crap.
XXX: pullup 7
2014-09-05 20:55:11 +00:00
skrll 79e4d54844 PR/48944: cron ignores '?' (question mark) time field
Fix the obvious merge botch.
2014-06-24 09:17:54 +00:00
christos a362d64092 even more detailed logging 2014-06-23 01:00:48 +00:00
dholland b30059e657 Log some actual information on various failures, so you can tell
what happened.
2014-06-21 04:33:53 +00:00
riastradh 6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
wiz a5684d07dd Use Mt for email addresses. 2013-07-20 21:39:55 +00:00
christos af0a310db8 PR/47362: Brian Marcotte: cron is too restrictive on file permissions
Allow file not being writable by owner.
XXX: pullup to 6.
2012-12-24 19:30:46 +00:00
christos 98b021fd71 make the utime and utimes cases work too. 2012-11-03 17:33:01 +00:00
christos 0a00da6dcc use utimensat(2) and correct and centralize file times handling. 2012-11-03 15:39:23 +00:00
tron d2071ea334 Fix multiple problems in previous commit:
1.) Correct set-uid check to allow "root" to run "crontab -l" again.
2.) Don't the the last error reported in "errno" in case "crontab" is not
    installed set-uid "root". As no system-call failed "errno" is set
    to zero.
2012-03-04 18:38:31 +00:00
christos 2ed8e2f0f4 PR/46127: Holger Weiss: "crontab <file>" fails for unprivileged users
XXX: Pullup to 6
2012-03-02 19:26:40 +00:00
christos 1a007818e3 simplify the bad extension code, by dsl. 2011-10-14 14:38:20 +00:00
joerg 158f0bd157 Kill redundant () 2011-10-13 16:58:30 +00:00
wiz 6bc209b109 Remove trailing whitespace. 2011-10-12 22:50:31 +00:00
christos 5a7c3e577e renamed len -> i but did not fix it everywhere. 2011-10-12 19:48:24 +00:00
christos 70b3f8cd32 process files in /etc/cron.d/ 2011-10-12 16:39:48 +00:00
christos 27ed5dfb1a - exit with ERROR_EXIT consistently
- don't use warnx() for things that set errno
- check result of setlogin()
- don't call setlogin() without calling setsid()
  should fix kernel warnings like:
	cron (pid NNNNN) changing logname from root to USER
	cron (pid MMMMM) changing logname from USER to root
2011-07-17 01:16:46 +00:00
christos bd253b6939 calling setlogin() once is good enough. 2011-07-17 01:14:25 +00:00
tron c4f7aae542 Use setenv(3) instead of putenv(3) because the later doesn't accept
string constants anymore.
2010-10-02 12:22:20 +00:00
christos 6533f925b7 Document the format of the system crontab file, since cron(8) says that we do. 2010-07-15 22:18:20 +00:00
christos 4d77e7cf65 PR/43623: Takahiro Kambe: Allow /etc/crontab processing if it is not writable,
don't insist that it is mode 0600.
2010-07-15 20:04:14 +00:00
christos 7035a6c5ea remove bad cast. 2010-07-15 20:03:28 +00:00
christos dbee6f29d8 PR bin/43591: Jeremy Reed: make sure that the default path is always set. 2010-07-10 21:42:29 +00:00
christos 9d32a81030 rename the allow and deny files to match the documentation. 2010-05-19 12:50:49 +00:00
christos 71a5eeb0d1 - The new cron keeps time internally as localtime. Revert to previous behavior
of keeping UTC, and handle timezones the way we handled them before (CRON_TZ).
  The old behavior can be selected with defining CRON_LOCALTIME.
- Provide functions to pretty-print crontab entries.
2010-05-18 21:49:51 +00:00