| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
crontab: ftruncate() with ftello() instead of ftell().
Obtained from: OpenBSD (CVS rev. 1.47)
|
|
|
|
|
|
| |
cron: use (char *)NULL instead of (char *)0 in execle.
Obtained from: OpenBSD (CVS Rev 1.25)
|
|
|
|
|
|
|
|
|
|
| |
cron: bring some fixes for Coverity reports and other issues.
crontab: replace malloc + bzero with calloc
crontab: properly free an entry
cron: Check the return value of pipe(2)
CID: 271773, 1009830,
|
|
|
|
|
|
|
|
|
| |
Bad timespec_subtract() calculations produce negative tv_nsec on i386
which cause EINVAL returned from nanosleep() which cause loop in
cron_sleep() and making all cron jobs to start about 30 seconds earlier
(which cause f.e. logfiles rotation by newsyslog delayed by 1 hour).
Use simple and proved calculations from kernel's timespecsub() instead.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
requests, default to the previous 60-seconds scheduling method
unless there is any @every_second entries to conserve CPU cycles and
power.
This change also improves scheduling in the default mode by running
as close to the beginning of the minnute as possible by replacing
sleep(3) with nanosleep(2). Previously, the tasks would run anywhere
within the first second of the minute and that offset drifted back
and forth each time cron(8) was engaged.
MFC after: 1 month
|
|
|
|
| |
Pointy hat to: sobomax
|
|
|
|
| |
with the r241649.
|
|
|
|
| |
Requested by: few
|
|
|
|
|
|
|
|
|
|
|
|
| |
not multiple of 1 second, which results in actual time to drift back
and forth every run within 1 second of the actual action has
been set for.
Suggested by: Ian Lepore
o Schedule the first run in 1 second after starting up, not on the
boundary of the next minute, which results in the every_second jobs
not being run.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
only available via the new @every_second shortcut. ENOTIME to
implement crontab(5) format extensions to allow more flexible
scheduling.
In order to address some concerns expressed by Terry Lambert
while discussing the topic few years ago, about per-second cron
possibly causing some bad effects on /etc/crontab by stat()ing
it every second instead of every minute now (i.e. atime update),
only check that database needs to be reloaded on every 60-th
loop run. This should be close enough to the current behaviour.
Add "@every_minute" shortcut while I am here.
MFC after: 1 month
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This structure is not part of POSIX. According to POSIX, gettimeofday()
has the following prototype:
int gettimeofday(struct timeval *restrict tp, void *restrict tzp);
Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is
not used). Remove dead error handling code. Also use NULL for a
nul-pointer instead of integer 0.
While there, change all pieces of code that only use tv_sec to use
time(3), as this provides less overhead.
|
|
|
|
|
|
|
|
|
| |
occurs in the same second as the earlier operations to create the temporary
file and the cron(8) daemon is rescans the spool directory during that
second, then the daemon may miss a cron edit and not properly update its
internal database.
MFC after: 1 month
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DST should not need to worry about scheduling jobs when the DST time
changes.
Rather than removing the BUGS section in crontab(5) regarding this,
note that disabling '-s' may still cause jobs to be executed twice or
not at all.
PR: 166318
Submitted by: Florian k Unglaub (f.unglaub%googlemail!com)
MFC After: 1 week
|
|
|
|
|
|
|
|
| |
information leak. This changeset is intended to be a minimal one
to make backports easier.
Reviewed by: kevlo, remko
MFC after: 1 week
|
|
|
|
| |
MFC after: 5 days
|
| |
|
|
|
|
|
|
|
|
|
| |
startup.
Discussed on: hackers@
Approved by: gjb (mentor)
MFC after: 1 week
|
|
|
|
|
|
|
| |
PR: 145912
Submitted by: Julian H. Stacey <jhs@berklix.com>
Obtained from: OpenBSD
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
environments.
Please note that this can't be done while such processes run in jails.
Note: in future it would be interesting to find a way to do that
selectively for any desired proccess (choosen by user himself), probabilly
via a ptrace interface or whatever.
Obtained from: Sandvine Incorporated
Reviewed by: emaste, arch@
Sponsored by: Sandvine Incorporated
MFC: 1 month
|
|
|
|
| |
Approved by: ru
|
|
|
|
| |
MFC after: 3 days
|
|
|
|
| |
MFC after: 3 days
|
|
|
|
|
|
| |
Pointed out by: glewis@
MFC after: 3 days
|
|
|
|
| |
MFC after: 3 days
|
|
|
|
|
|
| |
Tested with: make universe
MFC after: 3 days
|
|
|
|
|
|
| |
I should not commit anything at 3.50 AM.
In addition to danfe's comments, I got others.
I'll work on a better version of the patch.
|
|
|
|
|
| |
PR: 17363
MFC after: 3 days
|
|
|
|
|
|
| |
PR: bin/122137
Submitted by: Steven Kreuzer <skreuzer@exit2shell.com>
MFC after: 3 days
|
|
|
|
|
|
|
| |
PR: 122070
Submitted by: Steven Kreuzer <skreuzer@exit2shell.com>
Reminded by: gnn@
MFC after: 3 days
|
|
|
|
|
|
|
|
|
| |
hence output would be written to the wrong filehandle.
Submitted by: reg
Approved by: yar (implicit)
MFC after: ASAP
Pointy hat to: marck
|
|
|
|
|
|
|
|
|
|
|
| |
unless explicitly provided by MAILTO= line in crontab. This feature can be
useful in massive hosting environment, where most users do not care about
autogenerated mails.
Setting recipient to null string disables default mails at all.
Approved by: yar
MFC after: 4 weeks
|
| |
|
|
|
|
| |
Approved by: re (kensmith)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
by unavailable accounts, e.g., those locked, expired, not allowed in at
the moment by nologin(5), or whatever, depending on cron's pam.conf(5).
This applies to personal crontabs only, /etc/crontab is unaffected.
In other words, now the account management policy will apply to
commands scheduled by users via crontab(1) so that a user can no
longer use cron(8) to set up a delayed backdoor and run commands
during periods when the admin doesn't want him to.
The PAM check is done just before running a command, not when loading
a crontab, because accounts can get locked, expired, and re-enabled
any time with no changes to their crontabs. E.g., imagine that you
provide a system with payed access, or better a cluster of such
systems with centralized account management via PAM. When a user
pays for some days of access, you set his expire field respectively.
If the account expires before its owner pays more, its crontab
commands won't run until the next payment is made. Then it'll be
enough to set the expire field in future for the commands to run
again. And so on.
Document this change in the cron(8) manpage, which includes adding
a FILES section and touching the document date.
X-Security: should benefit as users have access to cron(8) by default
|
|
|
|
|
|
|
|
| |
as crontab(5) states it can be. This is supported by all vixie-cron derived
implementations; not sure why FreeBSD was any different.
PR: bin/106442
MFC after: 2 weeks
|
|
|
|
|
|
| |
rather than mis-parsing them as "X".
MFC after: 1 day
|
| |
|
|
|
|
| |
line while there.
|
|
|
|
| |
English trainer: ceri
|
| |
|
|
|
|
|
|
|
|
| |
setgid(2), setlogin(2) and initgroups(3). In theory they could
fail for root with some third party mac(4) policies.
Submitted by: Kostik Belousov
MFC after: 1 month
|
|
|
|
|
|
|
|
|
| |
"crontab /etc/crontab", but not the same format due to the who field.
Add some limited anti-foot-shooting support and refuse to load
/etc/crontab as someone's crontab. Users wishing shoot their foot in
this manner may copy /etc/crontab elsewhere. :)
MFC After: 1 week
|
|
|
|
|
|
|
| |
them for reading. When user can open file for reading, he can also
flock(2) it, which can lead to confusions.
Pointed out by: green
|
|
|
|
|
|
|
| |
Note, that when cron(8) cannot create pidfile, it'll exit. I didn't
changed this behaviour, but its better to ignore errors other than
EEXIST, so daemon can be started on systems where /var/ file system
doesn't support locking (like NFS without rpc.lockd(8)).
|
|
|
|
|
| |
Submitted by: Roman Divacky
MFC after: 3 days
|
|
|
|
| |
Discussed with: ru
|