Commit Graph

76 Commits

Author SHA1 Message Date
atatat 4e34961a55 Jobs specified for @reboot are only popped into the job queue at cron
startup time ("reboot" of cron, not the system), so okay_to_go() must
always say they are good to go.  Otherwise they never will.  All other
meta-timetags pertain to regular times, so they are (or were)
unaffected.

Problem noted by tron and successfully assigned to me by perry.
2003-08-13 03:51:15 +00:00
agc 326b2259b7 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22366, verified by myself.
2003-08-07 11:25:11 +00:00
hubertf e7469f38ad In "crontab -l", suppress the header lines, just as "crontab -e" does.
OK'd by Christos Zoulas and Paul Vixie.
Fixes PR 21705.
2003-06-23 22:36:02 +00:00
christos c7e6b87cad PR/3713: Aaron Brown: crontab fails with signals.
While I am here eliminate forking a shell for the editor.
2003-04-20 01:24:05 +00:00
jdolecek d70973544d use setproctitle() instead of uppercasing ProgramName
this makes the ps display nicer, and also avoids uppercasing the cron program
name in logs
idea from FreeBSD
2003-04-10 14:14:15 +00:00
perry eca50de83f set close on exec on a couple of FDs. from Charles Blundell PR security/16663 2003-04-04 01:24:09 +00:00
christos c2b5bf99ef PR/15142: Kevin P. Neal: cron does not pay attention to login_cap(3)
I simplified the patch addressed certain security concerns. I only
allowed setusercontext() to set resource limits/priority and umask,
because these are the values that are relevant from login.conf. The
rest of the settings (uid/gid/initgroups) should be done using e->uid
and e->gid like they were before, not from:

	struct passwd *pwd = getpwnam(getenv("LOGNAME"));

Finally login_cap's (path/env) are irrelevant in this context since
we want to use our e->envp anyway to execute the command.
2003-03-14 21:56:07 +00:00
dsl c17244d768 Create session before setting logname - we don't want to change the
parents logname (or any other children pre-empted in that window).
2003-02-19 09:21:15 +00:00
itojun 9593086444 use strlcpy 2002-11-16 04:34:13 +00:00
itojun dd84b30b3c license clarification, from openbsd 2002-10-02 06:47:48 +00:00
itojun 4fd217fda9 o Instead of passing "*system*" as the fname to process_crontab()
for the system crontab file, pass a NULL pointer instead.  This
  prevents someone from creating a "*system*" file in the tabs directory
  that acts as an alternate root crontab.

from openbsd
2002-08-03 02:03:00 +00:00
wiz fed48e80ae Unifdef __STDC__. 2002-07-14 09:59:23 +00:00
atatat 29bf0c2821 Implement CRON_TZ and CRON_WITHIN to provide finer control over job
execution.  CRON_TZ sets the time zone within which a job is
considered for execution (but not in which it runs), and CRON_WITHIN
allows jobs to be skipped whose execution is delayed for any reason
(eg, the system was sleeping or the load average is too high for
timely execution).
2002-04-25 14:45:05 +00:00
jdolecek d437ea659d child_process(): if the input_data didn't contain any '%', the pointer
ended up _after_ the final '\0', so the code past though there are some
data to be passed to the spawned command, causing child process
crash under some circumstances; adjust input_data in this case to avoid this

XXX this is already fixed in cron 4.0-b1 (though slighly differently)
2002-03-23 09:38:02 +00:00
ross 2a76afae02 Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:36:18 +00:00
wiz 5db87f557b Whitespace nits. 2002-01-19 03:09:21 +00:00
wiz 578af6b124 Fix xref. 2002-01-19 03:09:06 +00:00
wiz 3abdd84a78 Whitespace nits, and standardize an xref. 2002-01-19 03:08:50 +00:00
yamt cb1ee3b752 make consistent escape sequence handling
between commandline and command input.

pointed by Christoph Badura <bad@netbsd.org>
2001-08-13 06:54:58 +00:00
yamt 69ecbbeb80 Fix a bug that prevented %'s and \'s from being passed to the program
invoked.
from FreeBSD.
2001-08-03 04:10:51 +00:00
wiz 6b37581cf5 Restore default handler for SIG_CHLD before starting grand-children.
Idea by Christos Zoulas. Fixes bin/11778.
2001-03-13 17:51:50 +00:00
sommerfeld 057fcccd0c Default crontab size limit is 256k, not 32k; correct documentation to
match code.
2000-11-28 14:06:13 +00:00
enami f1fec63273 When @hourly is specified, set not just 23 but bit 0 through 22 also in
the bitstring e->hour.  Fixes PR#10961.
2000-09-13 04:07:34 +00:00
christos 250a1a772c PR/7662: TheMan: crontab does not think the file changed if the editing session
took < 1sec.
1999-05-29 18:43:40 +00:00
cjs d49fc436a6 Reduce default crontab size limit to 32K. Use the limit in
/var/cron/maxtabsize, if that file exists.
1999-04-09 02:47:03 +00:00
cjs a1d7b99e1e Make sure that the crontab is not an unreasonable size.
(Currently MAXCRONTABSIZE is 256 KB.)
1999-04-08 21:30:02 +00:00
thorpej bc5e782935 Don't rely on an `rcsid' being present. 1999-03-23 22:53:30 +00:00
aidan 3d3560d6aa Apply soda's patch to make environment sets act like the man-page
documentation.  i.e., strip the spaces around the '=' sign.
1999-03-22 22:18:45 +00:00
fair 47d8058ff9 Patch from PR#6570 to correct for some drift in the calculation of how
many seconds to sleep before next queue run.
1999-03-17 20:57:05 +00:00
aidan e04cec137b Allow quote-escaping of environment variable names so that they may contain
spaces again.
1998-10-12 22:15:47 +00:00
scw cae1a093d5 Quell a compiler warning introduced by the last change. 1998-10-11 10:27:46 +00:00
aidan 2169ed2a6f An environment variable name can no longer have spaces in it. This is to
let commands of the form
* * * * * command flag=value
be interpreted as commands instead of environment settings.
1998-10-07 23:18:29 +00:00
mycroft af3e07f7d1 __AUDIT__ cleanup. 1998-07-28 19:27:39 +00:00
mycroft 907740b591 Nuke redundant extern. 1998-07-26 13:27:34 +00:00
msaitoh 4944940fcf Declare ints, too, don't default them. 1998-07-09 18:32:52 +00:00
mrg 32f519716b - use an array MAXHOSTNAMELEN+1 size to hold hostnames
- ensure hostname from gethostname() is nul-terminated in all cases
- minor KNF
- use MAXHOSTNAMELEN over various other values/defines
- be safe will buffers that hold hostnames
1998-07-06 06:56:06 +00:00
kleink 3b86eeb257 Include <time.h> unconditionally, as there always dependencies on its
definitions.
1998-04-01 20:59:08 +00:00
christos 0499e8aedb WARNSify 1998-02-22 12:17:31 +00:00
thorpej 7137b45cd0 Cast time_t to long for printing. 1998-02-04 21:51:44 +00:00
christos 9f5b6131b3 Y2K fixes: in arpadate (currently not used) format the time using strftime,
using the format other mail programs use.
1998-02-04 15:27:19 +00:00
frueauf fbebae54cf check_error uses type "const char *" instead of "char *" as argument.
reflects recent change to cron.h.
1998-02-01 14:36:36 +00:00
christos 12a6e4b92e Add missing ARGS_MAX 1998-01-31 15:07:14 +00:00
christos 0335fca704 Remove crappy globbing stubs. If the feature needs to be added it should
be using glob(3).
1998-01-31 14:44:47 +00:00
christos 9ac7be0692 Warnsify:
- add __RCSID
	- remove nested comments
	- remove register and auto keywords
	- change into posix signals
	- fix prototypes
1998-01-31 14:40:13 +00:00
lukem 44c22033e4 use CPPFLAGS instead of CFLAGS 1997-10-23 06:31:59 +00:00
mycroft 004f255040 Use S_IS*(), not S_IF*. 1997-10-19 19:27:40 +00:00
lukem f5bf267d90 enable WARNS=1 by default, but disable in unclean 3rd party code 1997-10-18 06:42:25 +00:00
lukem ca32e63825 getopt returns -1 not EOF 1997-10-17 00:10:42 +00:00
mouse 2ebe693d57 Mark my changes, per Vixie's license at the top. 1997-07-20 02:54:55 +00:00
mouse 82b0af12ec Document the @ commands (@reboot, @hourly, etc).
Closes the rest of PR 2806.
1997-07-13 11:01:16 +00:00