summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron/do_command.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Check pipe(2) return value; noticed by deraadt@millert2015-11-171-3/+5
|
* Clean up the remaining uses of stderr and perror() and use warn/errmillert2015-11-151-53/+56
| | | | | | and/or syslog depending on whether stderr is hooked up at the time. Also remove closelog() which is not needed since we are headed for exec. OK guenther@
* Remove log_it() and call syslog(3) directly using the same format:millert2015-11-141-14/+11
| | | | | | | | "(username) WHAT (details)". Logs due to normal operation (e.g. crontab operations or running commands) are logged at LOG_INFO like before. Actual errors are logged at LOG_ERR, less important things are logged at LOG_WARNING OR LOG_NOTICE. Also ignore SIGHUP now that there is no log file to reopen.
* Remove unused xpid argument to log_it().millert2015-11-091-6/+6
|
* Change cron from including all headers in every file to only includingmillert2015-11-041-2/+24
| | | | | what each .c file needs. I have not removed cron.h since it will be used in a future clean up of the cron's .h files. OK nicm@
* Use stravis(3) instead of a homegrown vis-like function.millert2015-10-291-5/+7
| | | | OK nicm@
* Remove cron.pid support. We still want to avoid multiple cronsmillert2015-10-251-2/+1
| | | | | running so verify that if the cron socket exists nothing is listening on it. OK tedu@
* remove some more ifdef mazinesstedu2015-10-231-5/+1
|
* There is no need to keep a global array of sysconf(_SC_OPEN_MAX) elementstedu2015-10-031-3/+5
| | | | | | just to keep track of a single pid. Return it to the caller and make it their problem. ok deraadt millert
* unifdef some features we will always have. ok benno zhuktedu2015-10-031-23/+1
|
* correct copyright, upon approval from paul vixie via todd miller. thederaadt2015-02-091-5/+1
| | | | head copyright assertion was seperated from the remaining ones.
* braces to open a function go on their own line like god intendedtedu2015-01-231-4/+7
|
* Remove the OK and ERR macros. They obfuscate the code and don'ttedu2015-01-231-3/+3
| | | | | | | | | help legibility. (unix system calls use 0 for ok, but hundreds of other projects use 1 to indicate success.) Despite the name, many system calls (e.g., open) also return not OK values for success. It also cleans up some weird code like int crontab_fd = OK - 1; This diff is mechanical in nature. Later I will fix the bugs it reveals. ok deraadt
* minor debug removal cleanuptedu2015-01-231-2/+2
|
* remove debug code.tedu2015-01-231-49/+4
| | | | | | | | | | I think the level of debug code in cron is excessive for a program that has reached feature complete. If cron needs to provide more information to the user about its operational status, I think syslog would be more appropriate. (The debug flags also disable forking into the background, so they aren't even that useful for debugging a live system.) ok deraadt millert
* Replace MAXHOSTNAMELEN with HOST_NAME_MAX+1 and MAXNAMLEN with NAME_MAXmillert2015-01-141-2/+2
| | | | and use limits.h instead of sys/param.h.
* Use HAVE_FOO for BSD-specific features instead of relying on themillert2015-01-141-3/+3
| | | | BSD macro from sys/param.h.
* Use standard types for wait, readdir, signals and pids.millert2015-01-141-3/+3
|
* obvious unsigned char cast for ctypederaadt2013-11-231-2/+2
| | | | ok jca
* Allow a '+' in the MAILTO email adress; from Constantine A. Mureninmillert2013-03-071-2/+2
|
* Use standard EXIT_SUCCESS/EXIT_FAILURE and STD{IN,OUT,ERR}_FILENOmillert2011-08-221-19/+19
| | | | defines instead of using custom macros. OK deraadt@ gilles@
* Reset the SIGPIPE signal handler immediately before executing a command.millert2011-03-031-1/+3
| | | | | | We ignore it by default so cron doesn't die if sendmail is missing or exits prematurely but the actual command being run should have the default handler installed.
* Use _exit() not exit() after forking. OK deraadt@millert2010-12-141-3/+3
|
* rcsid[] and sccsid[] and copyright[] are essentially unmaintained (andderaadt2009-10-271-5/+1
| | | | | | | unmaintainable). these days, people use source. these id's do not provide any benefit, and do hurt the small install media (the 33,000 line diff is essentially mechanical) ok with the idea millert, ok dms
* Check fdopen() return value.millert2007-05-251-10/+13
| | | | | | | Ignore SIG_PIPE when writing to sendmail. This allows cron to still run jobs when sendmail is missing or broken (a warning will be logged). Move mailto variable to the same scope as mail and use the mail variable, not mailto, to test whether we have an open pipe to the mailer.
* privledges -> privilegesmiod2007-04-101-3/+3
|
* Add Auto-Submitted header in generated mail as per RFC 3834.millert2006-08-131-2/+3
| | | | OK henning@, ckuethe@, krw@, ian@. From Tamas TEVESZ.
* UUpdate ISC copyright year to 2004millert2004-06-171-13/+14
| | | | | Remove unused macros Skip_Line and MkLower Remove trailing whitespace
* Fix typo in last commit for non-compiled code. Dmitry V. Levinmillert2004-06-061-3/+3
|
* More changes from Dmitry V. Levin:millert2004-06-031-15/+16
| | | | | | | | Check return values for setgid, initgroups and setuid in code we don't compile. Print the correct filename for the at job in mail sent. Add some #if DEBUGGING in cron.c's usage(). Set sunlen each time before using it in accept(). Don't send mail at all if MAILTO is set but empty.
* isalnum() does not match '_' so check it explicitly. This allows cronmillert2004-04-261-3/+4
| | | | to send mail to usernames with a '_' in them. From David Gwynne.
* Use (char *)NULL instead of (char *)0 in execl and execle; Andrey Matveevmillert2003-07-301-5/+5
|
* Use setproctitle() instead of the CAPITALIZE_FOR_PS hack. Inspiredmillert2003-04-141-13/+4
| | | | | by similar changes in FreeBSD and NetBSD. For at jobs, include the job number in the proctitle.
* Sync with ISC cron-current + my at(1) integration.millert2003-02-201-10/+13
| | | | The at(1) code is now more tightly integrated into the cron codebase.
* Move closelog() into log_close() function and call that insteadmillert2002-08-081-5/+3
| | | | of calling closelog() (with #ifdefs) directly.
* fix typo (pw vs. pwd) in unused codemillert2002-07-151-3/+3
|
* Pass e->pwd to auth_setpwd() to avoid extra passwd lookup in BSD auth routinesmillert2002-07-151-4/+12
|
* Move atrun(8) functionality into cron(8) proper. This fixes themillert2002-07-151-32/+34
| | | | | | | | | | | | 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
* Do not collapse \\ -> \ in a command, the shell will be unhappy withmillert2002-07-121-3/+3
| | | | bare backslashes.
* Merge in some changes from Paul Vixie's tree; most are cosmeticmillert2002-07-081-2/+2
| | | | | | | | | | | 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
* uid_t and gid_t are unsignedderaadt2002-06-231-7/+7
|
* Correctly close the writing end of the pipe when dup'ing the fd tomillert2002-06-211-3/+3
| | | | | stdout. This was a pasto/thinko on my part. Problem found by jean-philippe wan-hoi.
* spelling; from Brian Poole <raj@cerias.purdue.edu>todd2002-06-141-3/+3
|
* Fix gethostname() usage.mpech2002-02-191-3/+3
| | | | deraadt@ ok
* Kill volatile now that jongjmp is history.millert2002-01-091-5/+5
|
* When becoming a daemon, dup stdin, stdout, and stderr to /dev/nullmillert2001-10-241-11/+14
| | | | | | 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.
* Update to ISC cron 4.0b1 + our patches. This is now under a BSD license.millert2001-02-181-166/+125
| | | | I also fixed the signal handlers while I was at it.
* snprintf sprinkles; solar@false.com & Ideraadt2000-08-211-3/+2
|
* Add calls to setusercontext() and login_get*(). We basically callmillert2000-08-201-3/+38
| | | | | setusercontext() in most places where previously we did a setlogin(). Add default login.conf file and put root in the "daemon" login class.
* Set SIGCHLD to SIG_DFL not SIG_IGN to prevent "perl -w" frommillert2000-06-031-2/+2
| | | | | | | | complaining "Can't ignore signal CHLD, forcing to default". Setting SIGCHLD to SIG_IGN means "don't provide exit status for my children" on some OSes which is not what we want--we just don't want to catch SIGCHLD since our parent does that for us.