summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron
Commit message (Collapse)AuthorAgeFilesLines
* MFC r308139, r308157-r308158bapt2016-11-165-11/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | r308139: cron(8): add support for /etc/cron.d and /usr/local/etc/cron.d For automation tools it is way easier to maintain files in directories rather than modifying /etc/crontab. The files in those directories are in the same format as /etc/crontab Reviewed by: adrian MFC after: 2 weeks Relnotes: yes Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D8400 r308157: Fix typo in cron(8) date Reported by: jilles r308158: Allow symlinks to be followed in cron.d directories and fix detection of regular files on NFS Reported by: jilles
* MFC r304570:trasz2016-11-032-4/+11
| | | | | | Add the "-n" flag to cron(8), to prevent it from daemonizing. This makes it possible to use it with external supervisors. The "-n" flag name is compatible with Linux, NetBSD, and OpenBSD.
* MFC r305269: cron: use existing maximum username constant MAXLOGNAMEemaste2016-09-052-2/+2
| | | | | | | | | | Previously cron had its own maximum username length limit, which was smaller than the system's MAXLOGNAME. This could lead to crontab -u updating the wrong user's crontab (if the name was truncated, and matched another user). PR: 212305 Reported by: Andrii Kuzik
* usr.sbin: minor spelling fixes on comments.pfg2016-05-012-3/+3
| | | | No functional change.
* crontab: ftruncate() with ftello() instead of ftell().pfg2016-02-161-1/+1
| | | | Obtained from: OpenBSD (CVS rev. 1.47)
* cron: use (char *)NULL instead of (char *)0 in execle.pfg2016-02-161-2/+3
| | | | Obtained from: OpenBSD (CVS Rev 1.25)
* Add sbin and /usr/local directories to _PATH_DEFPATH.jilles2016-01-051-2/+2
| | | | | | | | | | | | | | | | | Set _PATH_DEFPATH to /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin. This is the path in the default class in the default /etc/login.conf, excluding ~/bin which would not be expanded properly in a string constant. For normal logins, _PATH_DEFPATH is overridden by /etc/login.conf, ~/.login_conf or shell startup files. _PATH_DEFPATH is still used as a default by execlp(), execvp(), posix_spawnp() and sh if PATH is not set, and by cron. Especially the latter is a common trap (most recently in PR 204813). PR: 204813 Reviewed by: secteam (delphij), alfred
* Undo change from r292607 that was not meant to be therepfg2015-12-221-1/+1
| | | | Pointyhat: me
* cron: Check the return value of pipe(2)pfg2015-12-221-3/+5
| | | | | Fix inspired by: OpenBSD (rev 1.56) CID: 1009830
* crontab: properly free an entrypfg2015-12-221-1/+1
| | | | | | | This should close memory leak. Obtained from: OpenBSD (rev. 1.62) CID: 271773
* crontab: replace malloc + bzero with callocpfg2015-12-221-2/+1
| | | | Obtained from: OpenBSD (Rev 1.20)
* Add META_MODE support.sjg2015-06-133-0/+56
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-083-6/+0
| |
| * Merge sync of headsjg2015-05-273-6/+2
| |\ | |/ |/|
| * Merge from head@274682sjg2014-11-193-6/+5
| |\
| * \ Merge head from 7/28sjg2014-08-195-3/+7
| |\ \
| * | | Updated dependenciessjg2014-05-162-2/+0
| | | |
| * | | Updated dependenciessjg2014-05-102-0/+4
| | | |
| * | | Merge headsjg2014-04-281-20/+7
| |\ \ \
| * | | | Updated dependenciessjg2013-03-112-0/+2
| | | | |
| * | | | Updated dependenciessjg2013-02-163-6/+0
| | | | |
| | | | |
| | \ \ \
| | \ \ \
| | \ \ \
| *---. \ \ \ Sync from headsjg2012-11-046-32/+165
| |\ \ \ \ \ \
| * | | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-223-0/+61
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | | | | Readd Makefile.inc that were used to include upper level Makefile.inc andbapt2014-11-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | set (among other things) the destination where the binary should be installed
* | | | | | | Convert usr.sbin to LIBADDbapt2014-11-253-9/+2
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | Reduce overlinking
* | | | | | Revert r267233 for now. PIE support needs to be reworked.bdrewery2014-08-192-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. 50+% of NO_PIE use is fixed by adding -fPIC to INTERNALLIB and other build-only utility libraries. 2. Another 40% is fixed by generating _pic.a variants of various libraries. 3. Some of the NO_PIE use is a bit absurd as it is disabling PIE (and ASLR) where it never would work anyhow, such as csu or loader. This suggests there may be better ways of adding support to the tree. Many of these cases can be fixed such that -fPIE will work but there is really no reason to have it in those cases. 4. Some of the uses are working around hacks done to some Makefiles that are really building libraries but have been using bsd.prog.mk because the code is cleaner. Had they been using bsd.lib.mk then NO_PIE would not have been needed. We likely do want to enable PIE by default (opt-out) for non-tree consumers (such as ports). For in-tree though we probably want to only enable PIE (opt-in) for common attack targets such as remote service daemons and setuid utilities. This is also a great performance compromise since ASLR is expected to reduce performance. As such it does not make sense to enable it in all utilities such as ls(1) that have little benefit to having it enabled. Reported by: kib
* | | | | | Check gethostname(2) return code - but even if it succeeds it may notpeter2014-08-051-2/+5
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | null terminate. Temporarily use "From: $user@$hostname" rather than "From: $user". The latter exposes incompatible behavior if using dma(8). sendmail(8) (and other alternatives) canonify either form on submission (even if masquerading), but dma will leak a non-compliant address to the internet.
* | | | | use .Mt to mark up email addresses consistently (part2)bapt2014-06-203-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | PR: 191174 Submitted by: Franco Fichtner <franco@lastsummer.de>
* | | | | In preparation for ASLR [1] support add WITH_PIE to support building with -fPIE.bdrewery2014-06-082-0/+4
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is currently an opt-in build flag. Once ASLR support is ready and stable it should changed to opt-out and be enabled by default along with ASLR. Each application Makefile uses opt-out to ensure that ASLR will be enabled by default in new directories when the system is compiled with PIE/ASLR. [2] Mark known build failures as NO_PIE for now. The only known runtime failure was rtld. [1] http://www.bsdcan.org/2014/schedule/events/452.en.html Submitted by: Shawn Webb <lattera@gmail.com> Discussed between: des@ and Shawn Webb [2]
* | | | Bad timespec_subtract() calculations produce negative tv_nsec on i386ache2014-01-251-20/+7
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | 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. MFC after: 3 days
* | | Second attempt to add @every_second keyword support. Due to multiplesobomax2012-10-254-30/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Fully backout latest changes.sobomax2012-10-182-49/+6
| | | | | | | | | | | | Pointy hat to: sobomax
* | | Remove harmless, but superfluous local change that creeped in alongsobomax2012-10-171-1/+0
| | | | | | | | | | | | with the r241649.
* | | Revert latest changes to cron, until better version is worked out (I hope).sobomax2012-10-174-45/+10
| | | | | | | | | | | | Requested by: few
* | | o Use nanosleep(2) to sleep exact amount of time till the next second,sobomax2012-10-171-6/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Properly handle non-keyword case by setting e->second to 0.sobomax2012-10-161-0/+1
| | |
* | | Add per-second scheduling into the cron(8). Right now it'ssobomax2012-10-154-9/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Fix build with LOG_FILE undefined and DEBUGGING disabled.pluknet2012-10-021-0/+2
| | |
* | | Fix build with DEBUGGING disabled.pluknet2012-10-021-0/+4
| | |
* | | Rework all non-contributed files that use `struct timezone'.ed2012-09-011-2/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Add a one second sleep before touching the spool directory. If the touchjhb2012-07-021-0/+9
|/ | | | | | | | | 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
* As cron(8) is started with '-s' by default, timezones that observegjb2012-04-281-4/+15
| | | | | | | | | | | | | 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
* Drop setuid status while doing file operations to prevent potentialdelphij2012-02-271-12/+21
| | | | | | | | information leak. This changeset is intended to be a minimal one to make backports easier. Reviewed by: kevlo, remko MFC after: 1 week
* Since April 2, 2006, Indiana has observed DST.scf2012-01-281-2/+2
| | | | MFC after: 5 days
* Spelling fixes for usr.sbin/uqs2011-12-304-5/+8
|
* Point out that @reboot runs at every cron startup, not just systemwblock2011-11-251-1/+1
| | | | | | | | | startup. Discussed on: hackers@ Approved by: gjb (mentor) MFC after: 1 week
* List /var/cron/tabs in FILES and add descriptions for the other entries.brueffer2010-05-141-1/+5
| | | | | | | PR: 145912 Submitted by: Julian H. Stacey <jhs@berklix.com> Obtained from: OpenBSD MFC after: 1 week
* The last big commit: let usr.sbin/ use WARNS=6 by default.ed2010-01-021-0/+2
|
* Avoid sshd, cron, syslogd and inetd to be killed under high-pressure swapattilio2009-11-251-0/+4
| | | | | | | | | | | | | | 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
* Fix typo.skv2008-12-011-1/+1
| | | | Approved by: ru
OpenPOWER on IntegriCloud