summaryrefslogtreecommitdiff
path: root/usr.sbin/cron
AgeCommit message (Collapse)Author
2002-08-10Just zero out pw_passwd in the pw_dup()'d copy. There's no needTodd C. Miller
to do this elsewhere and my previous commit in this area caused problems on systems with an /etc/crontab file.
2002-08-08Move closelog() into log_close() function and call that insteadTodd C. Miller
of calling closelog() (with #ifdefs) directly.
2002-08-08Make wakeupKind an enum for clarity at Vixie's requestTodd C. Miller
2002-08-07paranoia: zero out pw_passwd since we don't need itTodd C. Miller
2002-08-04Extra paranoia -- check that pw_name matches the crontab user's name.Todd C. Miller
Should not really be needed since we do uid checks but it can't hurt.
2002-08-02o Instead of passing "*system*" as the fname to process_crontab()Todd C. Miller
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. o Fix the check for tab file ownership. This really only affected the system crontab file, which must not be owned by root. deraadt@ OK
2002-07-17Include limits.h since we use LONG_MAX; we squeaked by with anTodd C. Miller
implicit inclusion before.
2002-07-15fix typo (pw vs. pwd) in unused codeTodd C. Miller
2002-07-15Pass e->pwd to auth_setpwd() to avoid extra passwd lookup in BSD auth routinesTodd C. Miller
2002-07-15Move login_close() out of #ifdef BSD_AUTH blockTodd C. Miller
2002-07-15-Wall was for testingTodd C. Miller
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-12Do not collapse \\ -> \ in a command, the shell will be unhappy withTodd C. Miller
bare backslashes.
2002-07-11No need to compare sizes of new/old crontab file now that weTodd C. Miller
stash the st_mtimespec of the original and use that to compare.
2002-07-11More syncing with my cron 4.0 patch tree, basically cosmetic:Todd C. Miller
o change an instance of e_none to e_memory that I missed (forgot?) o kill some whitespace o modify malloc failure recovery a bit
2002-07-11Add a new error code for memory allocation failures, e_memory andTodd C. Miller
use that instead of e_none when we run out of memory.
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-09o Rename clean_turds() in crontab.c to die() and just _exit(ERROR_EXIT)Todd C. Miller
instead of resetting the signal handler to SIG_DFL and redelivering. o Use kill(2) instead of raise(3) (which is just a wrapper)
2002-07-09We already did a closelog(); no need for it here.Todd C. Miller
2002-07-08minor cosmetic change to reduce diffsTodd C. Miller
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-06-23uid_t and gid_t are unsignedTheo de Raadt
2002-06-21Correctly close the writing end of the pipe when dup'ing the fd toTodd C. Miller
stdout. This was a pasto/thinko on my part. Problem found by jean-philippe wan-hoi.
2002-06-14spelling; from Brian Poole <raj@cerias.purdue.edu>Todd T. Fries
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-22Remove pid file if sent SIGINT or SIGTERM before exiting.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-21Better handling of negative timeval than last commit.Todd C. Miller
2002-05-20Add a check for negative values in struct timeval after the timersub().Todd C. Miller
Just treat it like a zero value. Also check for errno != EINTR when select() returns -1.
2002-05-11.Xr at 1Todd C. Miller
2002-05-11Put options in a real list, preceded by "The options are as follows"Todd C. Miller
to conform to OpenBSD man page guidelines.
2002-05-09prototype open_socket()Todd C. Miller
2002-05-09nuke unused variableTodd C. Miller
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.
2002-05-08o Use proper #defines; It is HAVE_*, not HAS_*Todd C. Miller
o #ifdef out the -x flag getopt() stanza if not DEBUGGING
2002-02-19Fix gethostname() usage.Mike Pechkin
deraadt@ ok
2002-02-16Part one of userland __P removal. Done with a simple regexp with some minor ↵Todd C. Miller
hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
2002-01-09Kill volatile now that jongjmp is history.Todd C. Miller
2001-12-20Cause crontab to send SIGUSR1 when a user's crontab file has changed.Todd C. Miller
In cron, this interrupts the sleep() in cron_sleep() and causes cron to check to see what signal woke it up and act appropriately. This makes crontab changes take effect more or immediately.
2001-12-13Mention that cron should be started late in the rc file and why.Todd C. Miller
2001-12-12o pids should be pid_t, not intTodd C. Miller
o check return value of fscanf()
2001-12-11If we receive a signal during the sleep(), run signal handlers asTodd C. Miller
needed and then go back to sleep. This fixes the issue where processes run by cron could hang around as zombies for a minute (ie: until we were done sleeping).
2001-12-07do not call abort(), it is tastelessTheo de Raadt
2001-11-17save errno in signal handlerTheo de Raadt
2001-10-24When becoming a daemon, dup stdin, stdout, and stderr to /dev/nullTodd C. Miller
Change an unsafe vfork() to fork() Fix dup2() usage--must check for oldd == newd case and no need to close oldd Fixes annoying messages from sendmail about stdout being closed.