summaryrefslogtreecommitdiff
path: root/bin
AgeCommit message (Collapse)Author
2019-06-02In manpages, don't escape apostrophes as \'; it's rarely what you want.Anthony J. Bentley
Most of these are correct just as '. A few benefit from Ql or \(aq. But if in doubt, just use '.
2019-05-22mention that using vi command line editing mode requires enabling it;Ingo Schwarze
omission reported by Rudolf Sykora <rsykora at disroot dot org> on misc@; tweak and OK jmc@
2019-05-18freezero() is of no use here, the computed digest is not a secret.Otto Moerbeek
ok millert@
2019-04-03Bind ^L (C-l) to clear-screen instead of redrawJeremie Courreges-Anglas
Slightly more useful for some, same defaults as bash. No objection deraadt@ phessler@, ok tb@ kn@ benno@
2019-03-24detect -t argument being too long, rather than truncatingTheo de Raadt
2019-03-2416 chars is not enough for the maximum reach major() and minor()Theo de Raadt
could have, so let's formally expand the buffer to what it needs to be.
2019-02-20When evaluating an arithmetical expression, for example inside $(()),Ingo Schwarze
never do substitution (neither parameter, nor command, nor arithmetic, nor tilde substitution) on the values of any variables encountered inside the expression, but do recursively perform arithmetical evaluation of subexpressions as required. This makes behaviour more consistent, without hindering any behaviour promised in the manual page. A quirk originally reported by Andy Chu <andychup at gmail dot com> was that in the past, when encountering an array index, the shell would not only do evaluation, but also substitution on the array index, even though substitution would not be done on the expression in general. tobias@ contributed to initial efforts of understanding the quirk. patch tested in a bulk build by naddy@ "please commit" deraadt@
2019-02-16add fsync to STANDARDS;Jason McIntyre
2019-02-16Implement the conv=fsync feature which does an fsync(2) after theAlexander Bluhm
final write to output. GNU dd also has this. It is useful for write performance measurement or guaranteed writes to reliable storage. OK kn@ tedu@ deraadt@
2019-02-13(unsigned) means (unsigned int) which on ptrdiff_t or size_t or otherTheo de Raadt
larger types really is a range reduction... Almost any cast to (unsigned) is a bug. ok millert tb benno
2019-02-05Let ps(1) work in single user mode where /var/run does not exist.Florian Obser
Give the same treatment if /dev doesn't exist. While things will be real interesting without /dev there is no reason to stop ps(1). Fix suggested by & OK deraadt OK millert
2019-02-05dev_t is signed to permit passing -1 as an invalid condition, but theTheo de Raadt
decomposition into major and minor is unsigned, so we should print them with %u instead of %d. ok guenther
2019-01-28Implement cp -a ("archive" mode)Jeremie Courreges-Anglas
Not standard, but supported at least by GNU cp, IllumOS, NetBSD, FreeBSD, DragonflyBSD. No need to be gratuitously different. This should also allow us to drop patches in ~10 ports. Based on an initial diff by benno@ with input from sthen@ and jmc@ ok benno@ danj@ sthen@ martijn@ deraadt@
2019-01-25I am retiring my old email address; replace it with my OpenBSD one.Todd C. Miller
2019-01-22Add file # and block # to the information "mt status" shows.Kenneth R Westerback
diff from Oscar Endre Edvardsen via misc@ a long time ago. ok sthen@ dlg@
2019-01-22-p got changed to -f;Jason McIntyre
2019-01-21add a -f pformat flag to parse the given time with strptime.Ted Unangst
2019-01-14Fix three more buglets:Ingo Schwarze
1. Another off-by-one: if a mail file name ends in an (escaped) percent sign, do not forget to check whether the next byte is the percent sign introducing the message (MAILPATH='filename\%%msg'). 2. If the message is empty, use the default message rather than printing a blank line (MAILPATH='filename%'). 3. If the file name is empty, don't bother with mballoc(): the subsequent stat(2) can never succeed. (MAILPATH='%msg'). Found while reviewing the previous commit by tedu@. OK tedu@.
2019-01-14do not peek before the beginning of a stringTed Unangst
ok deraadt schwarze tb
2019-01-10Revert nanosleep(2) loop introduced in v1.25.cheloha
Now that nanosleep(2) handles the full input range transparently there is no longer a 100 million second upper bound and we can remove this loop. ok phessler@ jca@ visa@
2019-01-07short circuit mail check if MAIL is unset. ok antonTed Unangst
2018-12-30Delete unnecessary <libgen.h> #includesPhilip Guenther
ok deraadt@
2018-12-16Tweak the syntax displays to show that the list of wordsIngo Schwarze
in "for name in [word ...]; do list; done" can be empty. In sh(1), clarify what happens in that case. In ksh(1), clarify how it can happen that the list is never executed. OK jmc@ tb@
2018-12-08Fix kill [-SIGNAME | -s SIGNAME] and simplifyJeremie Courreges-Anglas
While the code intended to support both -s NAME and -s SIGNAME, the tests performed were wrong. Replace convoluted code with less cryptic conditionals. ok anton@
2018-12-07format a pair of dashes as "\(em" rather than "--",Ingo Schwarze
and a normal hyphen as "-" rather than "\-"
2018-11-30in getopts, when a option is followed by a colon the parameter is mandatorysolene
ok guenther@ deraadt@
2018-11-20Convert the pledge call to idiomatic format 'cause we love grep.Theo de Raadt
2018-11-20Fix the case where the recursion detection isn't reset when the command isMartijn van Duren
interrupted. Lots of back and forth with anton@ OK jca@, tb@, anton@
2018-11-17Use a very regular call pattern to pledge, so that we can continue toTheo de Raadt
grep and compare the use in all programs..
2018-11-16Include "id" in pledge (for setres[ug]id, setgroups) if the shell isNicholas Marriott
privileged and remove it when dropping privileges (set +p), setting a flag to make sure we don't do it again. ok deraadt millert
2018-11-14mv imitates, but no longer uses, cp and rm to cross filesystems.Ted Unangst
2018-11-10remove mention of sbrk.Daniel Dickman
ok tb@
2018-10-26Fix memory leak in setDolp() where dp is NULL. Based on a diff frommiko
netbsd, with help from martijn@ and millert@.
2018-10-24Fix some minor issues found by coverity.Martijn van Duren
OK millert@ and miko@
2018-10-17- add an example to date(1) showing how to convert between timezonesJason McIntyre
- update the description of TZ in date(1) - mention some relevant info to avoid sending the reader to another page and, when they have to refer to another page, send them to tzset(3) rather than environ(7) - update the timezone name used in environ(7), as advised by millert ok millert
2018-09-29Export the PWD and OLDPWD shell variables as per POSIX.Todd C. Miller
Previously, these would only be exported if they were present in the environment when the shell started. OK deraadt@ anton@ kn@
2018-09-28Contrary to the sh manual, it is possible to modify the PWD variableTodd C. Miller
(and this is allowed by POSIX). OK deraadt@ kn@
2018-09-19If getcwd() fails in dinit(), the stat buffer 'swd' is usedTodd C. Miller
uninitialized by the else clause. Since it is used in both clauses we should perform the stat before the if(). However, fixing this causes 'cp' to be unitialized in some case so initialize cp to NULL and move the "cp == NULL" check out of the first if() clause now that it can be true in either case. OK miko@ deraadt@
2018-09-19Fix last commit, I made one of the changes to the wrong line.Todd C. Miller
Noticed by martijn@
2018-09-19Compare against NULL, not '\0' for pointers. Quiets a warning onTodd C. Miller
newer gcc.
2018-09-18Restore the xmalloc(), xcalloc(), xreallocarray() and xstrdup() changes.Todd C. Miller
OK deraadt@
2018-09-18backout last week of csh diffs. They are disasterously broken, on i386Theo de Raadt
it becomes entirely unusable.
2018-09-18remove macros for xmalloc(), xcalloc() & xreallocarray() and just name themiko
functions that. ok millert@ martijn@
2018-09-17Replace any() with strchr(3).Martijn van Duren
OK millert@ and miko@
2018-09-16Use uid_from_user(3) and gid_from_group(3) in utilities thatTodd C. Miller
do repeated lookups. OK tb@
2018-09-15strsave() is hard-fail strdup() so simplify and rename to xstrdup().miko
with help from martijn@. ok millert@ martijn@
2018-09-13Fix warnings caused by user_from_uid() and group_from_gid() nowTodd C. Miller
returning const char *.
2018-09-13Use the new libc uid_from_user() and gid_from_group() instead ofTodd C. Miller
the pax-specific functions in cache.c. OK guenther@
2018-09-08blkfree() takes no action for NULL pointer so callers can avoid checking.miko
ok jca@
2018-09-07fgetln(3) -> getline(3); from Lauri Tirkkonen; ok millert@cheloha