summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* sh: Avoid copying argv for simple commands.jilles2015-11-013-11/+11
| | | | | Add dummy entries before and after so arglist's array is directly usable as argv.
* Update ls -l tests to use mtime, not birthtimeemaste2015-10-301-6/+6
| | | | | | | PR: 204155 Reviewed by: ngie, rodrigc Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4040
* Fix a ton of speelling errorseadler2015-10-211-1/+1
| | | | | | | arc lint is helpful Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com Differential Revision: https://reviews.freebsd.org/D3337
* Make libxo depend on libutil because it uses humanize_number after r287111ngie2015-10-181-1/+1
| | | | | | | | Remove overlinking in lib/libxo/tests, sbin/savecore, and usr.bin/{iscsictl,wc,xo} PR: 203673 Sponsored by: EMC / Isilon Storage Division
* Clean up trailing whitespacengie2015-10-181-9/+9
| | | | MFC after: 3 days
* Integrate contrib/netbsd-tests/bin/dd into the FreeBSD test suite asngie2015-10-182-0/+13
|\ | | | | | | | | | | | | | | | | | | bin/dd/tests Ensure fdescfs is mounted on /dev/fd/ for the length testcase as it's used in validating the characters read from /dev/zero MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
| * Integrate contrib/netbsd-tests/bin/dd into the FreeBSD test suite as ↵ngie2015-10-182-0/+13
|/ | | | bin/dd/tests
* Add more SUBDIR_PARALLEL.bdrewery2015-10-151-0/+2
| | | | | MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division
* Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andngie2015-10-1211-35/+2
| | | | | | | | | | | | netbsd-tests.test.mk (r289151) - Eliminate explicit OBJTOP/SRCTOP setting - Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk - Remove unnecessary TESTSDIR setting - Use SRCTOP where possible for clarity MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Divison
* sh: Make struct arglist an array instead of a linked list.jilles2015-10-116-215/+136
| | | | | | | | | | | This simplifies the code (e.g. allowing use of qsort(3) instead of a hand-rolled mergesort) and should have better cache properties. The waste of unused args arrays after resizes is approximately the same as the savings from getting rid of the next pointers. At the same time, remove a piece of global state and move some duplicated code into a function.
* Remove all of the syncsngie2015-10-101-10/+0
| | | | | | They're unnecessary as shown by further testing on my VM Requested by: jhb
* Call sync consistently using atf_checkngie2015-10-061-6/+6
| | | | Remove superfluous sync's
* Explicitly set BLOCKSIZE to 512 in the environmentngie2015-10-061-0/+1
|
* Add some more syncs to quiesce the filesystem after creating thengie2015-10-061-0/+4
| | | | files to see if this fixes deterministic Jenkin failures
* Start using the fact that SUBDIR.yes is added to SUBDIRimp2015-10-051-15/+4
| | | | | | | | | | | | | | | | | | and move from the pattern of: .if ${MK_FOO} != "no" SUBDIR+= bar .endif to SUBDIR.${MK_FOO}+= bar since we know that MK_FOO is always either yes or no and the latter form is easier to follow and much shorter. Various exception to this pattern dealt with on an ah-hoc basis. Discussed on arch@ a while ago.
* Merge additional testcases and improvements to bin/ls/ls_tests fromngie2015-10-052-64/+674
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ^/user/ngie/more-tests. - Additional testcases added: -- ls -D -- ls -F -- ls -H -- ls -L -- ls -R -- ls -S -- ls -T -- ls -b -- ls -d -- ls -f -- ls -g -- ls -h -- ls -i -- ls -k -- ls -l -- ls -m -- ls -n -- ls -o -- ls -p -- ls -q/ls -w -- ls -r -- ls -s -- ls -t -- ls -u -- ls -y - Socket file creation is limited to the ls -F testcase, greatly speeding up the test process - The ls -C testcase was made more robust by limiting the number of columns via COLUMNS and by dynamically formulating the columns/lines. - Add `atf_test_case` before all testcase `head` functions. X-MFC with: r284388, r288330, r288423 MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
* Initialize fd to -1 so that gcc doesn't emit an unitialized warning.sbruno2015-10-041-1/+2
|
* Make GCC happybdrewery2015-10-031-0/+1
|
* Use getaddrinfo() to fill struct sockaddr_un. It now supportshrs2015-10-031-16/+25
| | | | SOCK_DGRAM and SOCK_SEQPACKET in addition to SOCK_STREAM.
* wordexp: Rewrite to make WRDE_NOCMD reliable.jilles2015-09-304-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shell syntax is too complicated to detect command substitution and unquoted operators reliably without implementing much of sh's parser. Therefore, have sh do this detection. While changing sh's support anyway, also read input from a pipe instead of arguments to avoid {ARG_MAX} limits and improve privacy, and output count and length using 16 instead of 8 digits. The basic concept is: execl("/bin/sh", "sh", "-c", "freebsd_wordexp ${1:+\"$1\"} -f "$2", "", flags & WRDE_NOCMD ? "-p" : "", <pipe with words>); The WRDE_BADCHAR error is still implemented in libc. POSIX requires us to fail strings containing unquoted braces with code WRDE_BADCHAR. Since this is normally not a syntax error in sh, there is still a need for checking code in libc, we_check(). The new we_check() is an optimistic check that all the characters <newline> | & ; < > ( ) { } are quoted. To avoid duplicating too much sh logic, such characters are permitted when quoting characters are seen, even if the quoting characters may themselves be quoted. This code reports all WRDE_BADCHAR errors; bad characters that get past it and are a syntax error in sh return WRDE_SYNTAX. Although many implementations of WRDE_NOCMD erroneously allow some command substitutions (and ours even documented this), there appears to be code that relies on its security (codesearch.debian.net shows quite a few uses). Passing untrusted data to wordexp() still exposes a denial of service possibility and a fairly large attack surface. Reviewed by: wblock (man page only) MFC after: 2 weeks Relnotes: yes Security: fixes command execution with wordexp(untrusted, WRDE_NOCMD)
* Skip the B_flag testcase to stop blowing up freebsd-current@ withngie2015-09-301-0/+1
| | | | | "test failure emails" because kyua report-jenkins doesn't properly escape non-printable chars
* Add initial testcases for bin/lsngie2015-09-283-0/+373
|\ | | | | | | | | MFC after: 1 week Sponsored by: EMC / Isilon Storage Division
| * Start adding tests for bin/lsngie2015-06-143-0/+120
| |
* | Fix whitespace error in ls(1) detected by igorallanjude2015-09-271-3/+3
| | | | | | | | | | Approved by: bcr (mentor) Sponsored by: EuroBSDCon DevSummit
* | Use one fewer made up words in the ls(1) man pageallanjude2015-09-271-2/+2
| | | | | | | | | | | | | | PR: 203337 Submitted by: Mike Dame <damemi@gmail.com> Approved by: bcr (mentor) Sponsored by: EuroBSDCon DevSummit
* | Update META_MODE dependencies.bdrewery2015-09-171-0/+1
| |
* | Expose an interface to determine if an ACE is inherited.delphij2015-09-041-2/+4
| | | | | | | | | | | | | | Submitted by: sef Reviewed by: trasz MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3540
* | sh: Allow empty << EOF markers.jilles2015-09-023-2/+30
| |
* | sh: Fix read with escaped IFS characters at the end.jilles2015-08-303-12/+28
| | | | | | | | | | Characters escaped with a backslash must be treated as if they were not in IFS. This includes stripping trailing IFS characters.
* | sh: Add set -o nolog.jilles2015-08-294-5/+15
| | | | | | | | | | | | | | | | | | | | POSIX requires this to prevent entering function definitions in history but this implementation does nothing except retain the option's value. In ksh88, function definitions were usually entered in the history file, even when they came from ~/.profile and the $ENV file, to allow displaying their definitions. This is also the first option that does not have a letter.
* | Respect locale settings.delphij2015-08-281-0/+3
| | | | | | | | MFC after: 2 weeks
* | Use exit() instead of return in main().delphij2015-08-281-1/+1
| | | | | | | | MFC after: 2 weeks
* | sh: Fix out of bounds read when there is no ] after a [:class:].jilles2015-08-253-12/+17
| | | | | | | | | | | | | | | | | | | | | | The initial check for a matching ] was incorrect if a ] may be consumed by a [:class:]. The subsequent loop assumed that there must be a ]. Remove the initial check and make the loop cope with a missing ]. Found with afl-fuzz. MFC after: 1 week
* | Upgrade libxo to 0.4.5.marcel2015-08-242-2/+2
| | | | | | | | | | | | | | Local changes incorporated by 0.4.5: r284340 Local changes retained: r276260, r282117 Obtained from: https://github.com/Juniper/libxo
* | sh: Don't create bad parse result when postponing a bad substitution error.jilles2015-08-234-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | An invalid substitution like ${var@} does not cause a parse error but is stored in the intermediate representation, to be written as part of the error message. If there is a CTL* byte in the stored part, this confuses some code such as the code to skip an unused alternative such as in ${var-alternative}. To keep things simple, do not store CTL* bytes. Found with afl-fuzz. MFC after: 1 week
* | Make pkill/pgrep -j ARG take jname, not just jid.jamie2015-08-226-20/+78
| | | | | | | | | | | | PR: 201588 Submitted by: Daniel Shahaf <danielsh at apache.org> MFC after: 3 days
* | sh: Avoid negative character values from $'\Uffffffff' etc.jilles2015-08-203-5/+15
| | | | | | | | | | | | | | | | | | The negative value was not expected and generated the low 8 bits as a byte, which may be an invalid character encoding. The final shift in creating the negative value was undefined as well. Make the temporary variable unsigned to fix this.
* | sh: Add test for $'\u' without any digits.jilles2015-08-202-0/+8
| | | | | | | | | | It is likely that $'\uXXXX' and $'\UXXXXXXXX' will allow fewer digits in future. However, no digits at all should still be disallowed.
* | sh: Backslash-newline should not affect field splitting in read builtin.jilles2015-08-163-2/+21
| | | | | | | | This was originally broken in r212339 in 2010.
* | sh: When setting option via long name, don't go via letter.jilles2015-08-141-13/+20
| | | | | | | | | | Looking up the letter makes no sense and prevents adding options that only have a long name, no letter.
* | Cast uid and gid to the correct type for display to solve segfault in ls(1) ↵allanjude2015-07-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | on 32bit arches Correctly escape literal % for display This fixes segfaults in 32bit arches caused by r285734 Reviewed by: ngie Approved by: dim Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3191
* | Remove an excess space accidently introduced in the output in ls(1) by r285734allanjude2015-07-221-1/+1
| | | | | | | | | | | | | | Spotted by: dim Approved by: eadler (mentor) Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D3152
* | Fix some issues with the application of libxo to ls(1)allanjude2015-07-213-11/+45
| | | | | | | | | | | | | | | | | | | | * Add whitespace trimming to some fields (username, group, size, inode, blocks) to avoid whitespace in JSON strings * fix -m mode, was invalid JSON (repeated keys), and was missing outer array container * in -n mode, numeric uids and gids were returned as strings Approved by: eadler (mentor) Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D2854
* | Mention the dd-like recoverdisk(1) to help folks find this great BSD command.obrien2015-07-161-0/+1
| |
* | mdoc: minor Xr fixesjoel2015-07-141-2/+2
| |
* | Prevent potential integer overflowbapt2015-07-131-2/+5
| | | | | | | | | | PR: 192971 Submitted by: David Carlier <david.carlier@hardenedbsd.org>
* | Prevent potential integer overflowbapt2015-07-131-2/+6
| | | | | | | | | | PR: 192971 Submitted by: David Carlier <david.carlier@hardenedbsd.org>
* | Since r284198, ls(1) just always depends libxo(3), not only in case ofmarius2015-07-121-2/+2
| | | | | | | | MK_LS_COLORS or !RELEASE_CRUNCH.
* | sh(1): libedit has supported multibyte encodings for a while.jilles2015-07-111-4/+2
| |
* | mv: Improve message when moving two or more files to non-directory.jilles2015-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | The message text is from cp, which has had a nicer message for this since 2007 (PR bin/50656). As with cp, the exit status changes from 64 to 1. PR: 201083 MFC after: 1 week
OpenPOWER on IntegriCloud