summaryrefslogtreecommitdiff
path: root/bin
AgeCommit message (Collapse)Author
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
2018-09-07Revert earlier revert.Martijn van Duren
It turned out the issue was a badly applied diff on stsp@'s machine. OK stsp@
2018-09-07Backout recent cp(1) changes; they broke texlive's mktexlsr(1)Stefan Sperling
2018-09-07Rename dne in copy_file to exists to be more consistent with the otherMartijn van Duren
copy_* functions. OK stsp@
2018-09-07Also verify a overwrite for the copy of a fifo, link and device node.Martijn van Duren
OK stsp@
2018-09-07Move the question to allow a copy to its own function.Martijn van Duren
OK stsp@
2018-09-07The combination of -v and -i and the deny of a copy would cause the copyMartijn van Duren
still to be printed. This fixes that edge-case. OK stsp@
2018-08-25markup flag arguments; ok jmc@ schwarze@anton
2018-08-08unveil dev.db "r" for devname(), /dev "r", and in the non-sysctl caseTheo de Raadt
some kernel memory/symbol files.
2018-08-05use .Fl macro for command line optionsIngo Schwarze
2018-08-05wrong macroIngo Schwarze
2018-07-25Free operand copies after parsing.cheloha
We strdup operands before destructively parsing them to keep w(1) output looking nice and neat, but after parsing we ought to free them. We do need to keep copies for file paths, though, so add additional strdups for operands if and of. While here, use the preferred err(1, NULL) for an allocation failure. Also while here, don't assign `oper' to a copy of itself because it looks strange. "sure." deraadt
2018-07-23Don't cast malloc(3) size to u_int.cheloha
Large buffer sizes on 64-bit platforms cause the sum to wrap, leading read(2) to fail later. We check prior to this point that all buffer sizes are <= SSIZE_MAX. SSIZE_MAX * 2 < SIZE_MAX on all platforms, so the addition here will not overflow and cause a similar issue. Discovered by tobias@ a while back. ok deraadt millert tobias
2018-07-23Point to glob in section 7 for the actual list of special characters insteadkn
the C API in section 3. OK millert jmc nicm, "the right idea" deraadt
2018-07-11Do for most running out of memory err() what was done for most runningKenneth R Westerback
out of memory log_warn(). i.e. ("%s", __func__) instead of manual function names and redundant verbiage about which wrapper detected the out of memory condition. ok henning@
2018-07-09ensure tape name and tape commands are not too long. passing too longTheo de Raadt
commands to the other side could cause problems. ok guenther tb
2018-07-09Second attempt of the recently backed out variable expansion fix. This time withanton
a missing NULL check added by jca@ which fixes the segfault in the installer. ok jca@ tb@
2018-07-08Back out previous. naddy and rpe found that it breaks the installer withTheo Buehler
install.sub's ${*:+$*} substitution in addel(). ok jca
2018-07-08Fix a bug related to variable expansion referencing multiple read-onlyanton
variables; such as positional arguments. Since global() returns a pointer to static storage for read-only variables, the memory pointed to needs to be copied to prevent any subsequent call to global() to override the previously accessed variable. Bug reported by Andreas Kusalananda Kähäri on bugs@ ok benno@ jca@ tb@
2018-06-25Count $MAILCHECK with the monotonic clock.cheloha
So that ksh still looks for new mail every $MAILCHECK seconds, even if the system clock is rolled backward. ok anton@
2018-06-19Revert previous, there were some unintended beviour changes.Martijn van Duren
2018-06-18Use shl_out->fd instead of STDOUT_FILENO in the call the setupterm().Todd C. Miller
Suggested by anton@
2018-06-18Remove the parse_char_class and let regcomp determine if our bracketsMartijn van Duren
are balanced. OK millert@ and tb@
2018-06-18Add clear-screen emacs editing command, currently not bound to aTodd C. Miller
key by default. The shell will query the terminfo database to find the escape sequence to clear the screen. OK deraadt@