summaryrefslogtreecommitdiffstats
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* MFC r305358,r305449,r305451,r306367,r306397,r309474:ngie2017-02-101-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also contains a merge of ^/projects/netbsd-tests-update-12@r304035 . This change never hit ^/head because bin/cat's behavior was changed (on ^/head) to match NetBSD. PR: 210607 r305358: Update contrib/netbsd-tests with new content from NetBSD This updates the snapshot from 09/30/2014 to 08/11/2016 This brings in a number of new testcases from upstream, most notably: - bin/cat - lib/libc - lib/msun - lib/libthr - usr.bin/sort lib/libc/tests/stdio/open_memstream_test.c was moved to lib/libc/tests/stdio/open_memstream2_test.c to accomodate the new open_memstream test from NetBSD. Tested on: amd64 (VMware fusion VM; various bare metal platforms); i386 (VMware fusion VM); make tinderbox r305449: Install h_db to unbreak some of the lib/libc/db testcases after r305358 r305451: Fix lib/libc/rpc test assumptions added in r305358 - Require root in the tcp/udp subtests (it's needed on FreeBSD when registering services). - Skip the tests if service registration fails. r306367 (by br): Allow up to 6 arguments only on MIPS. r306397 (by br): Use right piece of code for FreeBSD. r309474: Don't build :strvis_locale if VIS_NOLOCALE is undefined The copy of contrib/libc-vis on ^/stable/10 doesn't contain all of the features in the ^/stable/11 // ^/head version, including VIS_NOLOCALE. The risk is lower in conditionally running the test instead of backporting the newer version of libc-vis
* MFC r289172,r290254:ngie2017-02-0911-35/+2
| | | | | | | | | | | | | | | | r289172: Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and 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 r290254: Remove unused variable (SRCDIR)
* In v3 UNIX, the kill utility is documented in category 8, not 1.sevan2017-02-031-2/+3
| | | | | | | | | | Add a note of it. http://minnie.tuhs.org/cgi-bin/utree.pl?file=V3/man/man8/kill.8 PR: 211786 Approved by: bcr (mentor) Obtained from: TUHS Differential Revision: https://reviews.freebsd.org/D8105
* MFC r310118asomers2017-01-121-1/+1
| | | | | | | | Fix ls_tests:o_flag with ZFS TMPDIR Unlike UFS or TMPFS, ZFS sets uarch automatically whenever a file is updated. The test must explicitly clear uarch to be portable across filesystems. Also, it doesn't need to run as root.
* MFC r310367:pfg2016-12-261-1/+4
| | | | | | | | | | pax(1): Fix a bug with archives smaller than 512 bytes. The problem here is that the archive is too short (< 512 bytes). The buffer routines, try to read at least 512 bytes, even when we try to determine what format file we have, which is wrong. Obtained from: NetBSD (CVS rev 1.26)
* MFC r310088, r310090, r310095brooks2016-12-212-4/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | r310088: Put the undocumented df feature of mounting filesystems from device nodes under an ifdef. Leave enabled. Reviewed by: cem Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8513 r310090: Mount filesystems without executable permissions since they should never be used. Reviewed by: cem Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8513 r310095: Use nmount(2) rather than the obsolete mount(2). Reviewed by: cem Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D8513
* MFC r309676vangyzen2016-12-151-6/+10
| | | | | | | | | | | | | Export the whole thread name in kinfo_proc kinfo_proc::ki_tdname is three characters shorter than thread::td_name. Add a ki_moretdname field for these three extra characters. Add the new field to kinfo_proc32, as well. Update all in-tree consumers to read the new field and assemble the full name, except for lldb's HostThreadFreeBSD.cpp, which I will handle separately. Bump __FreeBSD_version. Sponsored by: Dell EMC
* MFC r309238,309239:delphij2016-12-121-12/+12
| | | | | r309238: Plug a potential memory leak. r309239: style(9).
* MFH (r308297): use what(1) instead of strings(1).des2016-12-101-2/+2
| | | | | PR: 213665 Submitted by: Pawel Worach <pawel.worach@gmail.com>
* MFC r306722:sevan2016-10-161-1/+6
| | | | | | | | | Add history section for test(1) http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/cmd/test.c PR: 211789 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306721:sevan2016-10-161-1/+6
| | | | | | | | | Add history section for stty(1) http://minnie.tuhs.org/cgi-bin/utree.pl?file=V3/man/man1/stty.1 PR: 211788 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306720:sevan2016-10-161-1/+6
| | | | | | | | | Add history section of pwd(1) http://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s2/pwd.c PR: 211787 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306719:sevan2016-10-161-1/+17
| | | | | | | | | Document origins of expr & authors http://minnie.tuhs.org/cgi-bin/utree.pl?file=PWB1/usr/man/man1/expr.1 PR: 173979 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306718:sevan2016-10-161-1/+6
| | | | | | | | | | Add history section for echo(1) Sourced using the draft copy of the second edition manual http://www.tuhs.org/Archive/PDP-11/Distributions/research/1972_stuff/unix_2nd_edition_manual.pdf PR: 211785 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r267667:sevan2016-10-164-10/+7
| | | | | | | use .Mt to mark up email addresses consistently (part1) PR: 191174 Submitted by: Franco Fichtner <franco at lastsummer.de>
* MFC r306582:sevan2016-10-101-6/+5
| | | | | | | | | | "POSIX doesn't specify -h." - r1.27 from NetBSD http://man.openbsd.org/?query=chmod&apropos=0&sec=0&arch=default&manpath=POSIX-2013 PR: 212337 Approved by: bcr (mentor) Obtained from: NetBSD Differential Revision: https://reviews.freebsd.org/D8118
* MFC r306581:sevan2016-10-101-2/+2
| | | | | | | | Use .At macro instead of specifying AT&T UNIX literaly. PR: 212034 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8114
* MFC r306714:sevan2016-10-101-1/+9
| | | | | | | | | Document where chio(1) originated from & which version of FreeBSD first included it. PR: 211776 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* MFC r306584:sevan2016-10-101-5/+7
| | | | | | | | | | | Move the description of CHANGER variable to ENVIRONMENT section rather than in the DESCRIPTION section. From OpenBSD src/bin/chio/chio.1 r1.23 PR: 212158 Approved by: bjk Obtained from: OpenBSD Differential Revision: https://reviews.freebsd.org/D8117
* MFC r305841ache2016-09-221-6/+31
| | | | Implement multibyte encoding support for -v with fallback
* MFC r303423:kib2016-08-151-0/+1
| | | | Force SIGSTOP to be the first signal reported after the attach.
* MFC 302900,302902,302921,303461,304009:jhb2016-08-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a mask of optional ptrace() events. 302900: Add a test for user signal delivery. This test verifies we get the correct ptrace event details when a signal is posted to a traced process from userland. 302902: Add a mask of optional ptrace() events. ptrace() now stores a mask of optional events in p_ptevents. Currently this mask is a single integer, but it can be expanded into an array of integers in the future. Two new ptrace requests can be used to manipulate the event mask: PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK sets the current event mask. The current set of events include: - PTRACE_EXEC: trace calls to execve(). - PTRACE_SCE: trace system call entries. - PTRACE_SCX: trace syscam call exits. - PTRACE_FORK: trace forks and auto-attach to new child processes. - PTRACE_LWP: trace LWP events. The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have been replaced by PTRACE_SCE and PTRACE_SCX. PTRACE_FORK replaces P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS. The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for compatibility but now simply toggle corresponding flags in the event mask. While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both modify the event mask and continue the traced process. 302921: Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL. 303461: Note that not all optional ptrace events use SIGTRAP. New child processes attached due to PTRACE_FORK use SIGSTOP instead of SIGTRAP. All other ptrace events use SIGTRAP. 304009: Remove description of P_FOLLOWFORK as this flag was removed.
* MFC r301007:wblock2016-07-041-3/+3
| | | | Clarify the explanations for the hostname and FQDN entries.
* MFC r301582truckman2016-06-151-3/+3
| | | | | | | | | | | | | | | | Explicitly NUL terminate the buffer filled by fread(). The fix in r300649 was not sufficient to convince Coverity that the buffer was NUL terminated, even with the buffer pre-zeroed. Swap the size and nmemb arguments to fread() so that a valid lenght is returned, which we can use to terminate the string in the buffer at the correct location. This should also quiet the complaint about the return value of fread() not being checked. Reported by: Coverity CID: 1019054, 1009614 Secur3ty: Sponsore dby:
* MFC r300939:ngie2016-06-081-1/+1
| | | | | | | Use require.progs with bc instead of require.files with /usr/bin/bc This will make things more flexible if the program path changes in the future, and the test in and of itself doesn't call /usr/bin/bc -- it just calls bc
* MFC r301139truckman2016-06-081-1/+1
| | | | | | | | | | | | The (i < PROMPTLEN - 1) test added by r300442 in the code for the default case of \c in the prompt format string is a no-op. We already passed this test at the top of the loop, and i has not yet been incremented in this path. Change this test to (i < PROMPTLEN - 2). Reported by: Coverity CID: 1008328 Reviewed by: cem Differential Revision: https://reviews.freebsd.org/D6552
* MFC r300322, 300340:pfg2016-06-031-5/+2
| | | | | | | | | | ed(1): Cleanups for the DES mode. - Use arc4random_buf(3). - Prevent a segmentation fault when ed receives a signal while being in getpass(). [1] Obtained from: OpenBSD [1] (CVS Rev. 1.15)
* MFC r300692truckman2016-06-011-9/+18
| | | | | | | | | | Close the input FILE * in read_file() and the output FILE * in write_file() if read_stream() or write_stream() fails to avoid leaking the FILE. Reported by: Coverity CID: 977702 Reviewed by: pfg Differential Revision: https://reviews.freebsd.org/D6554
* MFC r300649truckman2016-06-011-2/+2
| | | | | | | | | | Fix Coverity CID 1019054 (String not null terminated) in setfacl. Increase the size of buf[] by one to allow room for a NUL character at the end. Reported by: Coverity CID: 1019054
* MFC r300648truckman2016-06-012-8/+11
| | | | | | | | | | | | | | Fix CID 1011370 (Resource leak) in ps. There is no need to to call strdup() on the value returned by fmt(). The latter calls fmt_argv() which always returns a dynamically allocated string, and calling strdup() on that leaks the memory allocated by fmt_argv(). Wave some const magic on ki_args and ki_env to make the direct assignment happy. This requires a tweak to the asprintf() case to avoid a const vs. non-const mismatch. Reported by: Coverity CID: 1011370
* MFC r300643truckman2016-06-011-0/+1
| | | | | | | Close from_fd if malloc() fails to avoid a file descriptor leak. Reported by: Coverity CID: 1007203
* MFC r300642truckman2016-06-011-3/+3
| | | | | | | Match the descriptions of the \H and \h prompt string sequences to reality. They were swapped. X-Confirmed by: jilles
* MFC r300442truckman2016-06-011-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Hopefully fix Coverity CID 1008328 (Out-of-bounds write) in /bin/sh. Replace the magic constant 127 in the loop interation count with "PROMPTLEN - 1". gethostname() is not guaranteed to NUL terminate the destination string if it is too short. Decrease the length passed to gethostname() by one, and add a NUL at the end of the buffer to make sure the following loop to find the end of the name properly terminates. The default: case is the likely cause of Coverity CID 1008328. If i is 126 at the top of the loop interation where the default case is triggered, i will be incremented to 127 by the default case, then incremented to 128 at the top of the loop before being compared to 127 (PROMPTLENT - 1) and terminating the loop. Then the NUL termination code after the loop will write to ps[128]. Fix by checking for overflow before incrementing the index and storing the second character in the buffer. These fixes are not guaranteed to satisfy Coverity. The code that increments i in the 'h'/'H' and 'w'/'W' cases may be beyond its capability to analyze, but the code appears to be safe. Reported by: Coverity CID: 1008328 Reviewed by: jilles, cem Differential Revision: https://reviews.freebsd.org/D6482
* MFC r299035: sh: Handle empty hostname and $PWD when building promptvangyzen2016-05-111-2/+3
| | | | | | If the hostname is empty and \h is used in $PS1, the remainder of the prompt following \h will be empty. Likewise for $PWD and \w. Fix it.
* MFC r298640:pfg2016-04-291-1/+1
| | | | ed(1): switch two statements so we check the index before dereferencing.
* MFC r295749:thomas2016-04-195-19/+47
| | | | | | | | | Reorganize the handling all-zeroes terminal block in sparse mode PR: 189284 (original PR whose fix introduced this bug) PR: 207092
* MFC 297673:mp2016-04-101-2/+2
| | | | | | | Revert r296969 by removing SAVESIGVEC and switching to fork instead. This fixes usage with system libraries which maintain their own signal state. PR: 208132
* MFC r277645: cp,mv,touch: Set timestamps with nanosecond precision.jilles2016-04-102-10/+10
| | | | This uses utimensat().
* MFC r259017: test: Avoid looking up again the type of a known binaryjilles2016-04-091-7/+6
| | | | operator.
* MFC r258799: test: Simplify the code by unifying op_num and op_type.jilles2016-04-091-78/+75
| | | | The global variable t_wp_op is no longer needed.
* MFC r297360: sh: Fix use-after-free if a trap replaces itself.jilles2016-04-093-1/+15
| | | | The mergeinfo for this commit was accidentally added to the previous commit.
* MFC r278818: sh: Add stsavestr(), like savestr() but allocates usingjilles2016-04-094-12/+16
| | | | stalloc().
* MFC r295147:ume2016-04-051-3/+3
| | | | | | | | | Make dynamic link of libiconv from ports work again. The symbols of libiconv from ports were changed to have prefixed. Since we have iconv in our libc these days, we don't need it on 10.X and later. However, 9.X still need this.
* MFC 296416:mp2016-03-171-0/+1
| | | | | | | | | | Signal handling within tcsh vfork code path will conflict with some system libraries (such as libthr) which maintain their own signal state. This change adds the tcsh SAVESIGVEC option to save and restore the sigvecs for the signals the child modifies before it execs. Reviewed by: kib, rwatson Reported by: kib
* MFC r289677:bdrewery2016-01-071-1/+1
| | | | Fix a ton of speelling errors
* MFC r292877:pfg2016-01-061-1/+1
| | | | | | | | | pax: prevent possible buffer overflow Or at least quiet down some static analyzers about it. CID: 978835 Obtained from: OpenBSD
* MFC r292517: sh/mknodes: Close files and check for errors when writing.jilles2015-12-271-5/+15
| | | | | | This is a build tool only and does not affect run time. PR: 204951
* MFC r292454, r292455pfg2015-12-261-4/+6
| | | | | | | | | ed(1): Prevent possible string overflows Use strlcpy to guarantee NULL termination. With hint from: imp, cem, ngie CID: 1007252
* MFC r292360: sh: Fix use-after-free when attempting to modify a read-onlyjilles2015-12-231-1/+1
| | | | | | variable. Reported by: bapt
* MFC r276669,r276723:ngie2015-12-152-0/+24
| | | | | | | | | | | | | | r276669: Integrate bin/cat/tests from NetBSD into atf/kyua Sponsored by: EMC / Isilon Storage Division r276723: Install d_align.{in,out} for the :align test Pointyhat to: me
OpenPOWER on IntegriCloud