summaryrefslogtreecommitdiff
path: root/usr.sbin/cron/misc.c
AgeCommit message (Collapse)Author
2002-08-08Move closelog() into log_close() function and call that insteadTodd C. Miller
of calling closelog() (with #ifdefs) directly.
2002-07-15Move atrun(8) functionality into cron(8) proper. This fixes theTodd C. Miller
long-standing annoyance that atrun's granularity is 10 minutes. Most at jobs run with a 1 minute granularity. Jobs submitted via "at now" or "batch" will run immediately. Includes a rewritten cron(8) man page. at(1) will be integrated more closely into cron at a future date. Upgrading notes: the atrun job in root's crontab should be removed. the /var/at/spool directory is no longer used
2002-07-09o Add _PATH_CRON_PID which is built up from PIDDIR and PIDFILE via stringTodd C. Miller
concatenation at compile time rather than run time. o Some minor cosmetic changes to simplify diffing.
2002-07-08Merge in some changes from Paul Vixie's tree; most are cosmeticTodd C. Miller
o ANSI function headers o return (foo) not return foo o add -oi to sendmail flags o update email address in man pages o make some strings const o completely remove globbing cruft from popen.c o whitespace changes o add DOW_STAR to flags for "monthly", "weekly", and "daily" cron entries
2002-05-28Kill an sscanf() in favor of strtol()Todd C. Miller
2002-05-28use %ld (long) for pidTheo de Raadt
2002-05-22Set close-on-exec flag for the socket cron selects on.Todd C. Miller
2002-05-22o avoid stdio in acquire_daemonlock() so we don't leak FILE * memoryTodd C. Miller
o fix potential long vs. int mismatch in pid reading/writing. Note that we can't use pid_t for the type of the variable stashed in the pidfile since we don't have a scanf format for pid_t. Use long instead since we know pid_t can't be bigger than a long. o just return if closeflag is set, regardless of the value of fd o fix potential (unwinnable?) race locking the pid file pointed out by dynamo. Using O_EXLOCK is not portable but it does help in these situations.
2002-05-09allowed() is only called once so there is no need to use staticTodd C. Miller
variables and leave the allow/deny files open. Previously, the allow/deny fd's were leaked during the crontab edit.
2002-05-09Missing piece from last commit.Todd C. Miller
2002-05-09Better error handling for in_file(); from OwlTodd C. Miller
2002-05-09crontab is no longer setuid root, it is now setgid crontab.Todd C. Miller
These changes were modelled after the Owl version of vixie-cron, but developed independently. Our crontab used to send cron SIGUSR1 to tell cron to reread the spool dir. Now that crontab is not setuid root this doesn't work. Instead, crontab pokes cron via a Unix domain socket located in the tabs dir. Please note, after these changes, the owner on user crontab files will have to be changed manually from root to the uid of the corresponding user for crontab to be usable. cron itself will accept tab files owned by either root or the user. Also, any /var/cron/{allow,deny} files must be readable by group crontab.
2001-12-12o pids should be pid_t, not intTodd C. Miller
o check return value of fscanf()
2001-02-20Turn get_gmtoff into a macro for OSes with tm_gmtoff (like OpenBSD).Todd C. Miller
Save the GMT offset in a global so cron_sleep can use it. This means the offset can only change in set_time() which is really what we want.
2001-02-19Normalize the time in minutes to GMT so we can really catch DST changesTodd C. Miller
(since time() does not change during a DST switch). This makes cron correctly detect DST changes. It does not fix the problem of wildcard jobs running multiple times. Also, don't rely on tm_gmtoff since that is non-standard (but use it when we have it).
2001-02-18Update to ISC cron 4.0b1 + our patches. This is now under a BSD license.Todd C. Miller
I also fixed the signal handlers while I was at it.
2000-08-21snprintf sprinkles; solar@false.com & ITheo de Raadt
1999-08-06uid_t and gid_t, and use %uTheo de Raadt
1998-07-10do not syslog() with "\n"; skipped smtpd/named/ipmon; 12 minutes of dabblingTheo de Raadt
1998-03-30Y2K fixes from Andreas.Gunnarsson@emw.ericsson.se; culled from various placesTheo de Raadt
1996-12-17use snprintf when storing the string from strerror(). Who knows howTodd C. Miller
long it could be esp. when locales come into the picture.
1996-11-01Check malloc/strdup ret val and deal.Todd C. Miller
1995-10-18initial import of NetBSD treeTheo de Raadt