summaryrefslogtreecommitdiff
path: root/usr.bin
AgeCommit message (Collapse)Author
2015-10-13Reject the escape sequences \[uD800] to \[uDFFF] in the parser.Ingo Schwarze
These surrogates are not valid Unicode codepoints, so treat them just like any other undefined character escapes: Warn about them and do not produce output. Issue noticed while talking to stsp@, semarie@, and bentley@.
2015-10-13Major character table cleanup:Ingo Schwarze
* Use ohash(3) rather than a hand-rolled hash table. * Make the character table static in the chars.c module: There is no need to pass a pointer around, we most certainly never want to use two different character tables concurrently. * No need to keep the characters in a separate file chars.in; that merely encourages downstream porters to mess with them. * Sort the characters to agree with the mandoc_chars(7) manual page. * Specify Unicode codepoints in hex, not decimal (that's the detail that originally triggered this patch). No functional change, minus 100 LOC, and i don't see a performance change.
2015-10-13Check if a file name can be extracted from a line before marking forMark Lumsden
deletion.
2015-10-13Ignore the setuid/setgid/sticky bits when copying the permissions of an inputTim van der Molen
file to the new output file. In preparation for pledge(2). Suggested by and OK millert@
2015-10-13Replace our /^\.\././ expression with /.//. The term is simpler and hasTobias Stoeckmann
the same meaning in our diff ed-context. As a bonus, our ed-diff output can be processed by GNU patch now, too. okay millert@
2015-10-13-C and -c allow at most one input file. Ensure this is the case when theTim van der Molen
input files are specified through --files0-from. OK millert@
2015-10-13apply PubkeyAcceptedKeyTypes filtering earlier, so all skippedDamien Miller
keys are noted before pubkey authentication starts. ok dtucker@
2015-10-13Reduce the amount of code by moving the three copies of the ohashIngo Schwarze
callback functions into one common place, preparing for the use of ohash for some additional purposes. No functional change.
2015-10-13pledge "stdio rpath wpath cpath"Theo de Raadt
2015-10-13ctype functions isxdigit() expect an unsigned char value; add missing castsPhilip Guenther
and adjust variable types to get correct behavior ok beck@ millert@
2015-10-13To alter just the atime of the mailspool, use utimensat()+UTIME_OMIT insteadPhilip Guenther
of stat()+utimes(). Prefer clock_gettime() over gettimeofday() to avoid timeval->timespec conversion ok millert@
2015-10-13Obvious pledge "stdio" for yes.Doug Hogan
ok deraadt@
2015-10-13free the correct IV length, don't assume it's always the cipherDamien Miller
blocksize; ok dtucker@
2015-10-12plegde(2) for apropos(1), help(1), man(1), mandoc(1), and whatis(1):Ingo Schwarze
Always needed: stdio rpath (to open multiple files and for .so) In addition after starting the pager: tmppath (to clean up the temp files) In addition before starting the pager: proc exec Looks good to deraadt@.
2015-10-12pledge(2) for makewhatis(8):Ingo Schwarze
Always needed: stdio rpath. In addition when writing to an existing db: wpath cpath fattr. In addition when creating a new db: proc exec. Based on work by and OK bentley@, "get moving" deraadt@.
2015-10-12Delete an assignment that is unconditionally overwritten two lines later;Ingo Schwarze
found by Svyatoslav Mishyn <juef at openmailbox dot org> with the clang static analyzer.
2015-10-12Garbage collect an unused variable, no functional change;Ingo Schwarze
found by Svyatoslav Mishyn <juef at openmailbox dot org> with cppcheck.
2015-10-12Check the right pointer against NULL;Ingo Schwarze
fixing a pasto introduced in the previous commit; found by Svyatoslav Mishyn <juef at openmailbox dot org> with cppcheck.
2015-10-12these callers of ttyname() no longer need to pledge "tty"Theo de Raadt
2015-10-12ttyname() no longer does ioctl TIOCGETA, so pledge("tty") is no longerChristian Weisgerber
needed here. ok deraadt@
2015-10-12Maintain a list of files marked for deletion while refreshing a diredMark Lumsden
buffer. Previously, when refreshing the buffer the files marked for deletion would be lost. Since the relationship between the files that have been marked for deletion and those that exist on disk is volatile, I have chosen to implement the discovery of marked files during the refresh function as opposed to maintaining a dired buffer specific list.
2015-10-12ftp(1) was static for years, as a recovery seatbelt. These daysTheo de Raadt
reliability has improved, and other repair methods are easier from bsd.rd or whatnot. As a static binary ftp has limited ASLR, yet it has 7 libraries... Making it non-static means the ASLR picture improves. Let's see who moans first. ok miod daniel
2015-10-12Use "-" rather than "\(hy" for the heads of .Bl -dash and -hyphen lists.Ingo Schwarze
In UTF-8 output, that renders as ASCII HYPHEN-MINUS (U+002D) rather than HYPHEN (U+2010), which looks better and matches groff. In ASCII output, it makes no difference. Suggested by naddy@.
2015-10-12Pledge "stdio wpath tty"; "awesome" deraadt@Tim van der Molen
2015-10-12in fuser mode with -k or -s mode, kill(2) might be called andTheo de Raadt
route lookups won't be needed; so expand the pledge setup to handle 3 codepaths. from theo buehler
2015-10-12These no longer need to be static. The ramdisk's no longer reach-aroundTheo de Raadt
and use the one in the base install, but have their own copy. ok millert sthen miod daniel
2015-10-12Correctly mark-up some recent additions. ok jmc@Mark Lumsden
2015-10-12Gahamas -> Bahamas;Jason McIntyre
from pgoyette (netbsd -r1.26)
2015-10-12same thing as biff, pledge "stdio rpath fattr tty"Theo de Raadt
2015-10-12biff pledges to only do "stdio rpath fattr tty". (very small program..Theo de Raadt
the actual order of use is tty, rpath, stdio or fattr)
2015-10-12Clear dform and dsec when exiting a first-level directory in treescan().Ingo Schwarze
Fixes a segfault reported by bentley@. While here, do some style cleanup in the same function.
2015-10-12Fix an obvious bug found during the /* FALLTHROUGH */ cleanup:Ingo Schwarze
ASCII_NBRSP has to be rendered as "&nbsp;", not "-".
2015-10-12To make the code more readable, delete 283 /* FALLTHROUGH */ commentsIngo Schwarze
that were right between two adjacent case statement. Keep only those 24 where the first case actually executes some code before falling through to the next case.
2015-10-11fix regression: ttyname() failure not handled rightTheo de Raadt
2015-10-11now that tsort has a clean structure, do more specific pledge() calls.Marc Espie
okay deraadt@
2015-10-11Drop tags containing a blank character:Ingo Schwarze
They don't work, they break other tags in weird ways, and even if they could be made to work, they would be mostly useless. Issue reported by naddy@, thanks.
2015-10-11-version options on commands like this make no sense; the version numberTheo de Raadt
makes no promises about compatibility nor the lack of compatibility. suggestion & diff from micheal reed
2015-10-11Finally use __progname, err(3) and warn(3).Ingo Schwarze
That's more readable and less error-prone than fumbling around with argv[0], fprintf(3), strerror(3), perror(3), and exit(3). It also shortens the code by 50 lines. It's a bad idea to boycott good interfaces merely because standards committees ignore them. Instead, it's the job of the portable distribution to provide compatibility modules for archaic systems (like commercial Solaris) that still don't have them. Actually, the compat code for the portable distribution already exists and will be committed right after this.
2015-10-11with the RPATH enforcement, csplit(1) don't work anymore on stdin...Sebastien Marie
the newfile() function used for create files open files in "w+" (O_RDWR), and may occasionally do reading on the file (function toomuch()). ok deraadt@
2015-10-11reorg code to have an array with all the files used apparent.Marc Espie
okay millert@
2015-10-11handle comma separated list of arguments, i.e. pkg-config --exists ↵Jasper Lievisse Adriaanse
gcr-3,gcr-base-3
2015-10-11fix a regression spotted by chris@. the -f and -I arguments fetch processTheo de Raadt
arguments using kvm_getargs, after the pledge() has been made. someone brave should refactor this, hoisting the argument fetching to between kvm_getprocs() and pledge() - storing the argument data as neccessary. the current situation is also a race -- it fetches the data twice.
2015-10-11Userspace doesn't need to use SUN_LEN(): connect() and bind() must acceptPhilip Guenther
sizeof(struct sockaddr_un), so do the simple, portable thing ok beck@ deraadt@
2015-10-10Initial support for pledges in openssl(1) commands.Doug Hogan
openssl(1) has two mechanisms for operating: either a single execution of one command (looking at argv[0] or argv[1]) or as an interactive session than may execute any number of commands. We already have a top level pledge that should cover all commands and that's what interactive mode must continue using. However, we can tighten up the pledges when only executing one command. This is an initial stab at support and may contain regressions. Most commands only need "stdio rpath wpath cpath". The pledges could be further restricted by evaluating the situation after parsing options. deraadt@ and beck@ are roughly fine with this approach.
2015-10-10another pledge argument reorder for sake of re-auditTheo de Raadt
2015-10-10Fix YP user and group support in getent(1).Doug Hogan
These should have been "stdio getpw" before, but they worked for non-YP environments. With YP, it won't work without "getpw". Reported by semarie@ and confirmed as a problem by miod@. ok deraadt@
2015-10-10pledge "stdio rpath wpath cpath"Theo de Raadt
ok doug
2015-10-10env(1) is obviously a program falling into pledge "stdio exec". ItTheo de Raadt
does stdio, and it does a raw execve(). It is so obvious. It gets only _exit(2), kbind(2), and 46 system calls -- over half of which are deeply gutted in their functionality to only serve narrow libc needs for "stdio (includes malloc)". the other 161 system calls kill it.
2015-10-10pledge "stdio inet rpath" seems to be enough for a YP environment.Theo de Raadt
rpath is to access /etc/rpc, and inet to talk to portmap & local world. ok beck
2015-10-10pledge "stdio rpath wpath cpath proc exec"; this spawns cpp.Theo de Raadt
ok doug