aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* diff: fix incorrectly displaying files as duplicatesJamie Landeg-Jones2021-01-253-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When diff hits certain access errors, function diffreg() shows the error message, and then returns to the calling function, which calls print_status() with the return value. However, in these cases, the return value isn't changed from the initial default value of D_SAME. Normally, print_status() with a value of D_SAME does nothing, so this works out ok, however, if the "-s" flag is set, a message is displayed showing identicality: case D_SAME: if (sflag) printf("Files %s%s and %s%s are identical\n", path1, entry, path2, entry); break; This then produces such results as: % diff -s /COPYRIGHT /var/run/rpcbind.sock diff: /var/run/rpcbind.sock: Operation not supported Files /COPYRIGHT and /var/run/rpcbind.sock are identical % diff -s /COPYRIGHT /etc/master.passwd diff: /etc/master.passwd: Permission denied Files /COPYRIGHT and /etc/master.passwd are identical Create a D_ERROR status which is returned in such cases, and print_status() then deals with that status seperately from D_SAME PR: 252614 MFC after: 1 week
* diff: add a test case for failed -s optionBaptiste Daroussin2021-01-251-0/+11
|
* elfctl: Fix type errors.Konstantin Belousov2021-01-231-3/+4
| | | | | | | | | | | | | | | Target value for val has uint32_t type, not uint, adjust used constant. Change val type to unsigned so that left and right sides of comparision operator do not expose different signed types of same range [*]. Switch to unsigned long long and strtoll(3) so that 0x80000000 is accepted by conversion function [**]. Reported by: kargl [*] Noted by: emaste [**] Reviewed by: emaste Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28301
* elfctl: fix typo from last-minute refactoringEd Maste2021-01-221-1/+1
| | | | | Reported by: jkim Fixes: 86f33b5fcf6087bf4439881011b920ff99e6e300
* elfctl: allow features to be specified by valueEd Maste2021-01-222-5/+35
| | | | | | | | | | | | | This will allow elfctl on older releases to set bits that are not yet known there, so that the binary will have the correct settings applied if run on a later FreeBSD version. PR: 252629 (related) Suggested by: kib Reviewed by: gbe (manpage, earlier), kib MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28284
* Complete Steps 5 and 9 from the Committer's guideLewis Cook2021-01-221-0/+1
| | | | | | | | | | | | | | | Summary: Steps 5 and 9: - Update Mentor and Mentee Information - Update Ports with Personal Information Reviewers: tcberner, fernape Reviewed By: fernape Subscribers: imp Differential Revision: https://reviews.freebsd.org/D28281
* Rename i386's Linux ELF to Linux ELF32Jessica Clarke2021-01-211-1/+1
| | | | | | | | | This is what amd64 calls the i386 Linux ABI in order to distinguish it from the amd64 Linux ABI, and matches the nomenclature used for the FreeBSD ABIs where they always have the size suffix in the name. Reviewed by: trasz Differential Revision: https://reviews.freebsd.org/D27647
* Remove remaining uses of ${COMPILER_FEATURES:Mc++11}Alex Richardson2021-01-191-3/+1
| | | | | | | | | | All supported compilers have C++11 support so these checks can be replaced with MK_CXX guards. See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252759 PR: 252759 Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D28234
* grep: fix LINKS in MakefileMartin Tournoij2021-01-181-1/+1
| | | | | | zstdegrep was listed twice, instead of zstdfgrep Pull Request: https://github.com/freebsd/freebsd-src/pull/450
* elfctl: prefix disable flags with "no"Ed Maste2021-01-141-4/+5
| | | | | | | | | | | | | | Some ELF feature flags indicate a request to opt-out of some feature, for example NT_FREEBSD_FCTL_ASLR_DISABLE indicates that ASLR should be disabled for the tagged binary. Using "aslr" as the short name for the flag is confusing as it seems to indicate a request for ASLR to be enabled. Rename "noaslr", and make a similar change for other opt-out flags. Reviewed by: bapt, manu, markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28139
* elfctl: add backwards compatibility for "no" prefixesEd Maste2021-01-141-0/+10
| | | | | | | | | | | | | | | | | I am going to prefix opt-out ELF feature flag names with "no" to make their meaning more clear (review D28139), but there are some uses of the existing names already (e.g., the PR referenced below). For now accept the older, unprefixed name as well, and emit a warning. We can revert this after FreeBSD 13 branches. % elfctl -e +aslr foo elfctl: interpreting aslr as noaslr; please specify noaslr PR: 239873 (related) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28140
* Merge bmake-20210110Simon J. Gerraty2021-01-142-35/+126
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quite a lot of churn on style, but lots of good work refactoring complicated functions and lots more unit-tests. Thanks mostly to rillig at NetBSD Some interesting entries from ChangeLog o .MAKE.{UID,GID} represent uid and gid running make. o allow env var MAKE_OBJDIR_CHECK_WRITABLE=no to skip writable checks in InitObjdir. Explicit .OBJDIR target always allows read-only directory. o add more unit tests for META MODE Merge commit '8e11a9b4250be3c3379c45fa820bff78d99d5946' into main Change-Id: I464fd4c013067f0915671c1ccc96d2d8090b2b9c
* | elftcl: add -i flag to ignore unknown flagsEd Maste2021-01-132-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | This may allow an identical elfctl invocation to be used on multiple FreeBSD versions, with features not implemented on older releases being silently ignored. PR: 252629 (related) Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28130
* | cmp: fix -s (silent) when used with skip offsetsEd Maste2021-01-112-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -s causes cmp to print nothing for differing files, for use when only the exit status is of interest. -z compares the file size first, for regular files, and fails the comparison early if they do not match. Prior to this change -s implied -z as an optimization, but this is not valid when file offsets are specified. Now, enable the -z optimization for -s only if both skip arguments are not provided / 0. Note that using -z with differing skip values will currently always fail. We may want to compare size1 - skip1 with size2 - skip2 instaead, and in any case the man page should be clarified. PR: 252542 Fixes: 3e6902efc802ab57fc4e9bf798f2d271b152e7f9 Reported by: William Ahern Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28071
* | cmp: use C99 bool for flagsEd Maste2021-01-114-14/+17
| | | | | | | | | | | | | | MFC after: 1 week Reviewed by: markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28072
* | ldd: renumber executable type constantsEd Maste2021-01-091-2/+2
| | | | | | | | | | | | | | | | ldd had #defines for AOUT, ELF, and ELF32. The removal of AOUT left a possibly confusing gap. These are not used anywhere but this file so renumber to avoid the gap. Reported by: allanjude
* | diff: honour flags with -qEd Maste2021-01-092-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously -q (just print a line when files differ) ignored flags like -w (ignore whitespace). Avoid the D_BRIEF short-circuit when flags are in effect. PR: 252515 Reported by: Scott Aitken Reviewed by: kevans MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28064
* | last(1): Add EXAMPLES sectionFernando Apesteguía2021-01-091-4/+22
| | | | | | | | | | | | | | | | | | | | | | Add two simple examples showing the use of the flags: d, n, s, t While here, reorder cross references properly by section Bump .Dd Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D27540 last(1): Bump .Dd
* | man(1): Bump .DdFernando Apesteguía2021-01-091-1/+1
| | | | | | | | From commit df965a6829f058b7a9999c39bc229616520645c2
* | man(1): Add EXAMPLES sectionFernando Apesteguía2021-01-091-0/+35
| | | | | | | | | | | | | | | | Add some examples showing the use of the flags: a, k, P, w Reviewed by: gbe@, yuripv@ Approved by: manpages (gbe@) Differential Revision: https://reviews.freebsd.org/D27545
* | ldd: Retire aout supportEd Maste2021-01-084-646/+0
| | | | | | | | | | | | | | | | | | | | | | Userland aout support has not been required since FreeBSD 2.x. If someone needs to use FreeBSD 2 shared libraries they will be best served by using a FreeBSD 2 ldd, perhaps as part of a jail with a full FreeBSD 2.x install. Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27478
* | du: tests: make H_flag tests more strict about output requirementsKyle Evans2021-01-071-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The current version of this test will effectively pass as long as one of the specified paths is in the output, and it could even be a subset of one of the paths. Strengthen up the test a little bit: * Specify beginning/end anchors for each path * Add egrep -v checks to make sure we don't have any *additional* paths * Ratchet down paths2 to exactly the two paths we expect to appear Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D27984
* | du: tests: fix the H_flag test (primarily grep usage)Kyle Evans2021-01-071-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test attempts to use \t (tab intended) in a grep expression. With the former /usr/bin/grep (i.e. gnugrep), this was interpreted as a literal 't'. The expression would work anyways because the tr(1) usage would ultimately replace all of the spaces with a single newline, and they would match the paths whether they were correctly fromatted or not. Current /usr/bin/grep (i.e. bsdgrep) is less-tolerant of ordinary-escapes, a property of the underlying regex(3) engine, to make it easier to identify when stuff like this happens. In-fact, this expression broke after the switch happened. This revision does the bare basics to fix the usage by using a printf to get a literal tab character to insert into the expression. It also swaps out the manual insertion of the line prefix into the grep expression by pulling that part out of $sep and reusing it for the leading path. The secondary issue was the tr(1) usage, since tr would only replace the first character of string1 with the first character of string2. This has instead been replaced by a sed expression, which similary understands \n to be a newline on all supported versions of FreeBSD. Each path now gets prefixed with the appropriate context that should be there (i.e. numeric sequence followed by a tab). PR: 252446 Reviewed by: emaste, ngie Differential Revision: https://reviews.freebsd.org/D27983
* | Rename NO_WERROR -> MK_WERROR=noAlex Richardson2021-01-073-4/+1
| | | | | | | | | | | | | | | | As suggested in D27598. This also supports MK_WERROR.clang=no and MK_WERROR.gcc=no to support the existing NO_WERROR.<compiler> uses. Reviewed By: brooks Differential Revision: https://reviews.freebsd.org/D27601
* | Fix -Wpointer-sign warnings in makefs and mkimgAlex Richardson2021-01-071-1/+1
| | | | | | | | | | Reviewed By: emaste Differential Revision: https://reviews.freebsd.org/D27175
* | Add some examples to script.1Mateusz Piotrowski2021-01-051-2/+68
| | | | | | | | | | | | | | | | | | | | | | While here: - Split synopsis into two parts. The first explains how to record sessions, while the second one explains how to replay (some of) the recorded sessions. - Fix the -width argument of the environment variables list. MFC after: 1 week
* | Improve readability of the options listMateusz Piotrowski2021-01-051-2/+2
| | | | | | | | MFC after: 3 days
* | pkgbase: Install atf and kyua in the tests packageEmmanuel Vadot2021-01-041-0/+6
| | | | | | | | | | | | | | While here make sure that all tests dirs are taggued correctly. Reviewed by: bapt, emaste Differential Revision: https://reviews.freebsd.org/D27714
* | fortune(6): Add EXIT STATUS and HISTORY sectionsGordon Bergling2021-01-031-1/+15
| | | | | | | | | | | | Obtained from: OpenBSD MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D27941
* | unzip: Sync with NetBSD upstream.Yoshihiro Takahashi2021-01-021-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Ignore malformed directory entries as created by Dropbox ("/"). (rev 1.24) - Use libarchive 3.x interface: check result for archive_read_free() and don't call archive_read_close manually. (rev 1.23) - Always overwrite symlinks on extraction, ever if they're newer than entries in archive. - Use getline() rather than getdelim(). PR: 231827 Submitted by: ak Reviewed by: mm Obtained from: NetBSD MFC after: 2 weeks
* | Replace strcat, strcpy and snprintf with bounds checking versionsStefan Eßer2020-12-311-46/+48
| |
* | Add "-n" flag to sockstat.Alexander Motin2020-12-302-4/+10
| | | | | | | | | | | | | | | | | | | | sockstat can "hang" on getpwuid() calls in situations when FreeBSD is joined to a directory service (AD/LDAP etc) and the directory service fail to answer in a timely manner when trying to resolve numeric UIDs to user names. Submitted by: Caleb St. John <caleb@ixsystems.com> MFC after: 1 week
* | Make calendarhome buffer staticStefan Eßer2020-12-301-1/+1
| | | | | | | | the value may be used in error messages after leaving this function.
* | bsdcat,cpio,tar: derive version string from archive.hXin LI2020-12-293-3/+6
| | | | | | | | | | | | Reviewed by: mm MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D27823
* | look(1): Add EXAMPLES sectionFernando Apesteguía2020-12-291-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add two simple examples. In this case I opted to show a small portion of the output since it helps to understand what the tool does. It shows the use of the -t flag too. PR: Submitted by: Reported by: Reviewed by: gbe@ Approved by: manpages (bcr@) Obtained from: MFC after: MFH: Relnotes: Security: Sponsored by: Differential Revision: https://reviews.freebsd.org/D27543
* | lsvfs(1): Add EXAMPLES sectionFernando Apesteguía2020-12-291-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add one simple exapmle and contrast some of the information using mount(8) PR: Submitted by: Reported by: Reviewed by: gbe@, yuripv@ Approved by: manpages (bcr@) Obtained from: MFC after: MFH: Relnotes: Security: Sponsored by: Differential Revision: https://reviews.freebsd.org/D27544
* | bsdcat,cpio,tar: Bump version number to 3.5.1Martin Matuska2020-12-273-3/+3
| | | | | | | | Matches import of libarchive 3.5.1
* | Adjust to display more than 999 sleeping threadsStefan Eßer2020-12-271-5/+5
| |
* | Statistics are for threads, not processesStefan Eßer2020-12-271-1/+1
| |
* | Decode and report native eventfd descriptors from libprocstat and procstat.Konstantin Belousov2020-12-272-0/+7
| | | | | | | | | | | | | | Submitted by: greg@unrelenting.technology Reviewed by: markj (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D26668
* | gprof: Retire a.out supportEd Maste2020-12-264-244/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FreeBSD has used ELF binaries/libraries for decades, but still has some support for legacy a.out binaries. Portions of this have been retired over time, but support remained in ldd, ldconfig, and gprof. Retire gprof support; if anyone needs to do development on a.out binaries still they will be best served by installing a full FreeBSD 2.x or other obsolete version in a jail. Kernel support for executing a.out binaries is unchnaged. Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D27480
* | grep: tests: stop testing for a nonexistent version of grepKyle Evans2020-12-251-16/+3
| | | | | | | | Differential Revision: https://reviews.freebsd.org/D27732
* | build: remove the option to build gnugrepKyle Evans2020-12-251-18/+8
| | | | | | | | | | | | | | | | | | Unconditionally install bsdgrep as grep, bootstrap or not. Remove all build glue and stop installing both gnugrep and libgnuregex now that all consumers of the latter are gone. Relnotes: yes Differential Revision: https://reviews.freebsd.org/D27732
* | patch(1): Fix a few mandoc related issuesGordon Bergling2020-12-191-6/+6
| | | | | | | | | | | | | | | | | | - no blank before trailing delimiter MFC after: 1 week Notes: svn path=/head/; revision=368807
* | uname(1): Fix a typo in the man page dateGordon Bergling2020-12-191-1/+1
| | | | | | | | | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=368806
* | ident(1): Normalizing date formatGordon Bergling2020-12-191-1/+1
| | | | | | | | | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=368805
* | login(1): when exporting variables check the result of setenv(3)Pedro F. Giffuni2020-12-191-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When exporting a variable we correctly check all the preconditions that could make setenv(3) fail. Checking the setenv(3) return value seems redundant, but given that login(1) is critical, it doesn't hurt to have a post-check. This change is based on the "Principles of Secure Coding" course by Matthew Bishop, PhD., which specifically discusses this code in FreeBSD. (This change redoes r368776 due to a silly mistake) Notes: svn path=/head/; revision=368778
* | Revert r368776:Pedro F. Giffuni2020-12-191-4/+1
| | | | | | | | | | | | | | | | | | | | login(1): when exporting variables check the result of setenv(3) mismatch: the return value upon error is -1, so the code was not doing nothing. Notes: svn path=/head/; revision=368777
* | login(1): when exporting variables check the result of setenv(3)Pedro F. Giffuni2020-12-191-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When exporting a variable we correctly check all the preconditions that could make setenv(3) fail. Checking the setenv(3) return value seems redundant, but given that login(1) is critical, it doesn't hurt to have a post-check. This change is based on the "Principles of Secure Coding" course by Matthew Bishop, PhD., which specifically discusses this code in FreeBSD. Differential Revision: https://reviews.freebsd.org/D26966 Notes: svn path=/head/; revision=368776
* | Add ELF flag to disable ASLR stack gap.Konstantin Belousov2020-12-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Also centralize and unify checks to enable ASLR stack gap in a new helper exec_stackgap(). PR: 239873 Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=368772