summaryrefslogtreecommitdiff
path: root/usr.bin/at
AgeCommit message (Collapse)Author
2019-11-29at(1): ctime comparison: subtraction is not comparison; ok millert@cheloha
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-02-16When specifying the time in the form HHMM or HH:MM, if that timeChristian Weisgerber
is already past, the next day is assumed. Handle the case where we're still in the same hour but the minutes are past. ok deraadt@ millert@
2018-03-16improve markup quality in the cases found by the new "--" style messageIngo Schwarze
2018-01-31Sync list of non-exported environment variables with at.c.Todd C. Miller
2017-06-15Finer grained pledge for at(1). After setegid(), do a three-way pledge:Theo Buehler
For AT and BATCH: "stdio rpath wpath cpath fattr getpw unix" For ATRM: "stdio rpath cpath getpw unix" For ATQ and CAT: "stdio rpath getpw" "unix" is needed for poke_daemon() and "fattr" to chmod +x spoolfile. idea and ok millert
2017-06-07In cron(8), require that crontab and at files in the spool be ownedTodd C. Miller
by group crontab. The at(1) command now creates files owned by group crontab, the crontab(1) command already does this. Files in the crontab spool with parse errors are now ignored; crontab(1) will not install a crontab file with parse errors. The system crontab file (/etc/crontab) is not affected by this. The required permissions on crontab files have been tightened. Files in the cron spool must be mode 0600 (as created by crontab(1)). The system crontab file may be readable/writable by the owner, readable by group and readable by other. The system crontab must be readable by the owner.
2017-03-18Use recallocarray for growth of the jobs, just because it is a littleTheo de Raadt
beefier than pointers.
2016-10-31Delete setlocale(LC_TIME, "").Ingo Schwarze
The only place where this could potentially get used was the strftime(3) for fprintf(3) "job %s at %s\n" to stderr. We don't want base system utilities to talk to users in foreign languages. No functional change on OpenBSD which doesn't provide any non-standard LC_TIME locale anyway. Patch from Jan Stary <hans at stare dot cz>. In main(), exit -> return while here. OK millert@
2016-03-30for some time now mandoc has not required MLINKS to functionJason McIntyre
correctly - logically complete that now by removing MLINKS from base; authors need only to ensure there is an entry in NAME for any function/ util being added. MLINKS will still work, and remain for perl to ease upgrades; ok nicm (curses) bcook (ssl) ok schwarze, who provided a lot of feedback and assistance ok tb natano jung
2015-11-16Make "at -l" comply with POSIX. Our "at -l" currently acts likeTodd C. Miller
the historic BSD atq which takes a list of users instead of a list of jobs. We now accept either a user or a job number for "at -l". The "at -l user" syntax is still accepted but no longer documented. This is similar to how we handle differences in "at -r" vs. atrm. OK deraadt@ jmc@
2015-11-13Use crontab-style syslog calls in at.Todd C. Miller
Remove check_permission and just call allowed() directly.
2015-11-13There's no need for at.c globals to be extern.Todd C. Miller
2015-11-12Use absolute paths in pathnames.h. There is no longer a need toTodd C. Miller
chdir(2) to the cron dir and cron(8) now changes to / via daemon(3). We no longer try to create/chmod the spool directories as they should be set correctly at install time. The setegid(crontab) has been moved to open_socket() so it is closer to the chmod(2) call that needs it. OK deraadt@ tedu@
2015-11-11at already uses O_EXCL when creating files so there's no need toTodd C. Miller
lock the spool dir. OK jca@
2015-11-11Use warn/warnx here too.Todd C. Miller
2015-11-11Remove bogus DST code. mktime() handles DST automatically whenTodd C. Miller
tm_isdst is set to -1.
2015-11-11Use warn/warnx where sensible and add fatal/fatalx wrappers forTodd C. Miller
err/errx that unlink atfile as needed. OK deraadt@
2015-11-11Use fstatat(), openat() and unlinkat() when operating on files inTodd C. Miller
the at queue so we don't need to chdir to the queue dir. OK guenther@
2015-11-09Rename AT_DIR -> AT_SPOOL and SPOOL_DIR -> CRON_SPOOL to improveTodd C. Miller
readability.
2015-11-06Use __progname instead of the homegrown ProgramName.Todd C. Miller
2015-11-04Change cron from including all headers in every file to only includingTodd C. Miller
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@
2015-11-03It is only necessary to swap the effective gid when reading a file.Todd C. Miller
An attacker exploiting an overflow can change the egid themselves so running with the egid of the user in other places just gives you a false sense of security. OK nicm@ deraadt@
2015-10-31Split client-only (at, crontab) functions out of misc.c and intoTodd C. Miller
client.c. Move truly common functions into common.c. This avoids dead code in the at and crontab commands.
2015-10-28pledgeTheo de Raadt
ok millert
2015-09-09The .Nd macro is intended to provide "a one line description", so avoidIngo Schwarze
multiple lines of input, in particular, don't use macros below .Nd; such bad style can confuse various apropos(1) tools. All deleted macros reappear later in the text, anyway, except for .Tn, which i'm deleting outright. Found while scanning the tree for good and bad practices in preparation for my EuroBSD2015 mdoc(7) tutorial on Oct 1 in Stockholm.
2015-08-20Do not cast result of malloc/calloc/realloc* if stdlib.h is in scopeTheo de Raadt
ok krw millert
2015-03-17Eliminate use of TM_YEAR_BASE. OK guenther@ deraadt@ miod@Todd C. Miller
2015-03-15tzfile.h is an internal header that should never have been installed.Todd C. Miller
What's worse, the tzfile.h that gets installed is over 20 years old and doesn't match the real tzfile.h in libc/time. This makes the tree safe for /usr/include/tzfile.h removal. The TM_YEAR_BASE define has been moved to time.h temporarily until its usage is replaced by 1900 in the tree. Actual removal of tzfile.h is pending a ports build. Based on a diff from deraadt@
2015-01-23don't need to define debugging 0 anymoreTed Unangst
2014-10-08userland reallocarray audit.Doug Hogan
Replace malloc() and realloc() calls that may have integer overflow in the multiplication of the arguments with reallocarray(). ok deraadt@
2014-09-29When setting environment variables in the atrun script, use theTodd C. Miller
"export foo=bar" form instead of "foo=bar; export foo" since the former allows the shell to catch variable names that are not valid shell identifiers. This will cause /bin/sh to exit with an error (which gets mailed to the at user) and it will not run the script. OK miod@
2014-09-16no need to discuss sendmail (or any particular mailer) here;Jason McIntyre
while here, \*(Gt -> >, per ingo;
2014-03-17as suggested by schwarze, reshuffle STANDARDS text detailing posix featuresJason McIntyre
we don;t support next to the posix compat blurb, in order to make things a bit clearer; this also makes the text more concise; ok millert schwarze sobrado
2014-02-15macro cleanup, mostly to use .Cm for fixed stringsIngo Schwarze
to be passed as command line arguments; from Jan Stary <hans at stare dot cz>, tweaked by me
2014-01-30STANDARDS: at.allow/deny is xsi (same as cron);Jason McIntyre
2014-01-13Add the "next" keyword as an alias for "+ 1" for relative times.Todd C. Miller
Also support "months" and "years" keywords when specified as relative time units. All as per POSIX. Man page changes OK jmc@ sobrado@
2014-01-09flesh out some details in STANDARDS regarding timespec;Jason McIntyre
ok sobrado millert
2013-11-25variety of unsigned char casts (or conversions) for ctypeTheo de Raadt
ok krw
2013-07-16use .Mt for email addresses; from Jan Stary <hans at stare dot cz>; ok jmc@Ingo Schwarze
2013-04-17Adapt cron and at for future large time_t and tv_sec types. These were someTheo de Raadt
of the harder programs to adapt, so let me know if problems happen. tested by guenther, gilles, chl, others
2011-09-04have the -t argument name in the options list match that of SYNOPSIS;Jason McIntyre
ok millert
2011-08-31have the timespec arguments match in case those of time_arg;Jason McIntyre
2011-08-31Copy description of the -t option and its argument with revised textPhilip Guenthe
from the touch(1) manpage after much discussion with jmc@ and miller@
2011-08-30Same fix as 'touch': with the -t option, when the year is specifiedPhilip Guenthe
but the century isn't, the century is 1900 if year >= 69; otherwise it's 2000. (With 32bit time_t, this does't affect any working usage.) ok millert@
2011-08-23Use standard EXIT_SUCCESS/EXIT_FAILURE and STD{IN,OUT,ERR}_FILENOTodd C. Miller
defines instead of using custom macros. Missed in last commit.
2011-03-20Add two missing lines that got missed when I did the initial at + cronTodd C. Miller
merge.
2011-03-03Use dirfd() instead of peeking into struct dirent for dd_fd, which isTodd C. Miller
non-standard.
2010-09-03add an EXIT STATUS section for /usr/bin;Jason McIntyre
2010-07-21document exit values; from daniel dickmanJason McIntyre