aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
* calendar: don't setlogin(2) in the -a user handlersKyle Evans2024-09-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | As of e67975d331 ("Fix 'calendar -a' in several ways."), `calendar -a` will now fork off a new process for each user and do all of its own processing in the user's own context. As a side-effect, calendar(1) started calling setlogin(2) in each of the forked processes and inadvertently hijacked the login name for the session it was running under, which was typically not a fresh session but rather that of whatever cron/periodic run spawned it. Thus, daily and security e-mails started coming from completely arbitrary user. We could create a new session, but it appears that nothing calendar(1) does really needs the login name to be clobbered; opt to just avoid the setlogin(2) call entirely rather than incur the overhead of a new session for each process. PR: 280418 Reviewed by: des, olce Fixes: e67975d331 ("Fix 'calendar -a' in several ways.") (cherry picked from commit 6cb8b61efe8899ee9194563108d0ae90c1eb89e3) (cherry picked from commit 33708452aaabca205d81eceb83e0813e5882815c) Approved by: so
* Remove $FreeBSD$: one line sh-patternJose Luis Duran2023-10-1929-31/+1
| | | | | | | | | | | | Remove the $FreeBSD$ pattern added to the tests, as well as fixing the mkimg_test.sh script to stop adding it when we rebase the tests. Reviewed by: imp, emaste Pull Request: https://github.com/freebsd/freebsd-src/pull/870 (cherry picked from commit 3b5c9845727a1b95098379f66223525e85e8a73f) (cherry picked from commit 9ed4f43bc4c39dc5ed2ce1bf6003e4dcb4160bfc) Approved-by: re (cperciva)
* mkimg: Regenerate all the tests for gptWarner Losh2023-10-1928-3754/+3798
| | | | | | | | | | | Recent changes to mkimg has changed the generated GPT images to be more correct. Use make rebase to regenerate the baseline. Sponsored by: Netflix (cherry picked from commit d2abbfede5342b19f3e5994140cdb6622c95ef66) (cherry picked from commit 524225dde0b5a4f346644670f22fcd11fe13c1f2) Approved-by: re (cperciva)
* mkimg_test: remove vtoc8 images, they aren't neededWarner Losh2023-10-1928-4472/+0
| | | | | | | | | | vtoc8 support expired with sparc64 removal, so remove them all. Sponsored by: Netflix (cherry picked from commit 83bd5a833c3a14b74736e7b3fa0be66252a5a3dc) (cherry picked from commit 4a3cdf4168953c01b8b0e6a9ca72804ef2860309) Approved-by: re (cperciva)
* mkimg: Ensure GPT Entry Array is at least 16kWarner Losh2023-10-191-4/+12
| | | | | | | | | | | | | | | | | | | | UEFI v2.10 Section 5.3 documentes that the minimum reserved space after the GPT header be at least 16kB. Enforce this minimum. Before, we'd only set the number of entries to be the unpadded size. gpart's selective enforcement of aspects of the GPT standard meant that these images would work, but couldn't be changed (to add a partition or grow the size of a partition). This ensures that gpart's overly picky standards don't cause problems for people wishing to, for example, resize release images. MFC after: 1 day (we want this in 14.0) PR: 274312 Sponsored by: Netflix Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D42245 (cherry picked from commit 9b42d3e12ffc6896fcb4e60c1b239ddf60705831) (cherry picked from commit 5401ebd33cf5073e8c0f095527504d38f74a926b) Approved-by: re (cperciva)
* Add mitigations(7) describing our vulnerability mitigationsEd Maste2023-10-132-3/+6
| | | | | | | | | | | | | | | | | | | | This is an initial take on documenting vulnerability mitigations. Connect mitigations(7) to the build Also add some cross references. Reviewed by: gbe (earlier) Sponsored by: The FreeBSD Foundation Co-authored-by: Olivier Certner <olce.freebsd@certner.fr> Differential Revision: https://reviews.freebsd.org/D41794 (cherry picked from commit b6a61ac2d475fba9c45f7f407549a522f60dea18) (cherry picked from commit 6e5dcc6113da649a79e5bc2c3ea9329bcd1d85d5) (cherry picked from commit a2b289608d6b54b6e1ce85096560807e551bb5ac) (cherry picked from commit 272bc4597d0b41eebdfa7c108778070665acb431) Approved by: re (gjb)
* switch groff parameter -man to -mandocWolfram Schneider2023-10-121-2/+2
| | | | | | | | | | | | | groff 1.23.0 changed the semantics of the -man parameter, and many manual pages are not rendered. The -mandoc parameter brings back the old behavior, as in groff 1.22.4 and earlier. PR: 273565, 273245 Approved by: re (delphij) (cherry picked from commit 035f7c9a3653d91564a5513f1311aa3b6e14a17e) (cherry picked from commit 7f9f152307652d1cb454acb8b9018f29672b452f)
* Add deprecation notices to publickey(5) toolsEd Maste2023-09-244-0/+16
| | | | | | | | | | | | Reviewed by: imp, manu MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D40144 (cherry picked from commit d5ef73a71f0e2fbc4dc9b907a6e59a15599c50b3) (cherry picked from commit 84266fb897e6e75569a81418f146f134af04046b) Approved by: re (gjb)
* grep: Suppress EISDIR when reading.Dag-Erling Smørgrav2023-09-141-0/+2
| | | | | | | | | | | MFC after: 1 week Sponsored by: NetApp, Inc. Sponsored by: Klara, Inc. Reviewed by: kevans Approved by: re (delphij) (cherry picked from commit caf5283fc92edb83173752b1dafbc6d586e78815) (cherry picked from commit 24b741db5fc907d35e51c97f8ef8ad595474e6b9)
* localedef: add newlines to error messagesKyle Evans2023-09-106-27/+27
| | | | | | | | | | | | | | These won't be added elsewhere, so add a little bit of room to make these messages a little easier to read. The existing set is a mixed bag, there are somewhere in the ballpark of 45, 46 printfs to stderr and 19 of those had newlines. Reviewed by: yuripv Approved by: re (kib) Sponsored by: Klara, Inc. (cherry picked from commit 3141e51d2e38fa7b9e6d81477dfa860d087c514d) (cherry picked from commit dc8ee27074d4060549c6ecdc88eeec386691b479)
* localedef: correct definition of right-parenthesis in default charmapKyle Evans2023-09-101-1/+1
| | | | | | | | | | | It turns out that right parentheses do exist and are different than left parentheses, so let's switch to that. Approved by: re (kib) Sponsored by: Klara, Inc. (cherry picked from commit 07bc20e4740d09f554c3787bb1940fc503300822) (cherry picked from commit 8d98eb4e51eb1777b6bdb3682dbd7472c9cc2c71)
* include: Implement N2867.Dag-Erling Smørgrav2023-09-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This adds macros for checked addition, subtraction, and multiplication with semantics similar to the builtins gcc and clang have had for years. Reviewed by: kib, emaste Differential Revision: https://reviews.freebsd.org/D41734 (cherry picked from commit e6615b10347caf67f5bc12c9a8e30b8ddd9860ae) include: Add tests for N2867. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D41735 (cherry picked from commit 4fbb9c43aa44d9145151bb5f77d302ba01fb7551) less: We have <stdckdint.h> now. Reviewed by: delphij Differential Revision: https://reviews.freebsd.org/D41736 (cherry picked from commit cb8dd292c7ec53391dfa25847858dd7ef895f94e) Approved by: re (gjb)
* unifdef: Handle redefined symbols correctly.Dag-Erling Smørgrav2023-09-071-0/+21
| | | | | | | | | | | MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D41758 (cherry picked from commit aacbe7384221d2eafa326864bbbe2f22a10063ce) Approved by: re (gjb)
* split: Add missing test cases.Dag-Erling Smørgrav2023-09-072-23/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds test cases for c4f7198f47c1 and ac17fc816e67. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D41755 (cherry picked from commit cbea5eddb1b6ae2a101beacf00bf165517f4f2b1) split: Code cleanup. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D41756 (cherry picked from commit 851bf856d1a7ad5427ea9c22639ab6f6c4a3f503) split: Fix linecount parsing. The “undocumented kludge” which unfortunately can't be dropped for backward compatibility reasons was prone to segfaulting and would improperly allow a new linecount when one was already set. Fix these issues and add regression tests. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D41757 (cherry picked from commit 117c54a78ccd214c236806721f21da750e512d3e) Approved by: re (gjb)
* m4 tests: Update tests after $FreeBSD$ removalMark Johnston2023-08-232-2/+2
| | | | Fixes: d54a7d337331 ("Remove $FreeBSD$: one-line m4 tag")
* unifdef: Vendorize.Dag-Erling Smørgrav2023-08-214-2298/+3
|
* Remove my middle name.Dag-Erling Smørgrav2023-08-179-9/+9
|
* Remove $FreeBSD$: one-line lua tagWarner Losh2023-08-161-1/+0
| | | | Remove /^--\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line catalogWarner Losh2023-08-167-7/+0
| | | | Remove /^\s*\$\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line bare tagWarner Losh2023-08-1610-13/+0
| | | | Remove /^\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-16161-161/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: two-line nroff patternWarner Losh2023-08-1683-166/+0
| | | | Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161302-1304/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: alt one-line .c patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*__RCSID\("\$FreeBSD\$"\);\n/
* Remove $FreeBSD$: alt two-line .c patternWarner Losh2023-08-162-4/+0
| | | | Remove /^\s*__RCSID\("\$FreeBSD\$"\);\n\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-16417-832/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* Remove $FreeBSD$: two-line .c patternWarner Losh2023-08-1652-156/+0
| | | | Remove /^#include\s+<sys/cdefs.h>.*$\n\s+__FBSDID\("\$FreeBSD\$"\);\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-1686-86/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-1659-59/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: two-line .h patternWarner Losh2023-08-16142-284/+0
| | | | Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line m4 tagWarner Losh2023-08-1619-19/+0
| | | | Remove /^dnl\s*\$FreeBSD\$.*$\n/
* netstat(1): fix manpage dateDoug Rabson2023-08-161-1/+1
| | | | MFC after: 1 week
* netstat(1): teach netstat to attach to jailsDoug Rabson2023-08-163-13/+128
| | | | | | | | Add -j <jail> flag to netstat(1) to allow access to network information from a jail. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D41446
* systat: Remove obsolete copyright stringWarner Losh2023-08-161-6/+0
| | | | | | | This is unused, so remove it. We don't put a copyright string in most of the other binaries. This one doesn't need one either. Sponsored by: Netflix
* etdump: warn only once for non El Torito bootable ISO imagesEd Maste2023-08-151-3/+2
| | | | | Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D39869
* MFV: less v643.Xin LI2023-08-131-9/+9
| | | | MFC after: 2 weeks
* cpuset(8): move to /bin/Enji Cooper2023-08-115-729/+0
| | | | | | | | | | | | | | | | | | | | | | Summary: This change moves /usr/bin/cpuset to /bin/cpuset so it is more readily available on hosts where the /usr partition might not be mounted at the time / has been mounted. Remove some complexity from rc.subr(8) since /bin is assumed to always be present if/when / is mounted. MFC after: 2 weeks MFC with: 0661f93892a2, 271d552379af Test Plan: - Test out rc.subr change. - Confirm that the installation logic does what's needed. Relnotes: yes (moving cpuset may impact strict file permissions/mode checking) Reviewers: kevans Subscribers: imp Differential Revision: https://reviews.freebsd.org/D40057
* Unbreak usr.bin/dc with OpenSSL 3Enji Cooper2023-08-112-6/+6
| | | | | | | | | OpenSSL's BN_zero API has had a void return value since 1.1.x: chase the change to unbreak the build on OpenSSL 3.x with MK_GH_BC == no. MFC after: 2 weeks Reviewed by: emaste, kevans Differential Revision: https://reviews.freebsd.org/D41410
* tcopy: Pick up max blocksize from sysctl kern.maxphysPoul-Henning Kamp2023-08-101-0/+6
|
* patch: don't run off the end of path if it ends in '/'.Pedro F. Giffuni2023-08-071-1/+2
| | | | | | Found by fuzzing (afl) in OpenBSD. Obtained from: OpenBSD (CVS 1.65)
* unzip: swtich to bsdunzip from libarchiveMartin Matuska2023-08-046-1349/+181
| | | | | | | | | Unzip from FreeBSD has been ported to libarchive. Change usr.bin/unzip to use bsdunzip from libarchive. Differential Revision: https://reviews.freebsd.org/D41239 PR: 272845 (exp-run) MFC after: 1 month
* man: fix `man -K` searchEd Maste2023-08-021-3/+3
| | | | | | | | | | Quote re arg to grep in case it has spaces, and quote [:blank:] tr arg to avoid the shell interpreting []. PR: 272729 Reviewed by: Mina Galić <freebsd@igalic.co> Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41282
* retire SHARED_TOOLCHAIN knobEd Maste2023-08-024-16/+0
| | | | | | | | | | | | | Toolchain components were historically statically linked. They became normal dynamically linked executables in commit 6ab18ea64d19. There is no need to keep a special case build option for the toolchain; users who want statically linked toolchain (or any other) components can use the existing NO_SHARED knob. Reviewed by: dim, sjg Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41266
* xargs tests: Disable the test added in commit eab91d008165Mark Johnston2023-07-311-2/+4
| | | | | | This test has been triggering OOM kills in CI runs since it triggers an allocation of 16GB. Temporarily disable the test until the problem is solved one way or another.
* usr.bin/gh-bc: fix Makefile for WITHOUT_NLS_CATALOGS caseStefan Eßer2023-07-291-8/+8
| | | | | | | | | Some macro definitions had been moved into a Makefile section that depends on MK_NLS_CATALOGS != "no", leading to LTO and the installation of tests being disabled in the WITHOUT_NLS_CATALOGS case. Reported by: Yuri <yuri@aetern.org>
* netstat -i: compute most field widths dynamicallyMike Karels2023-07-262-77/+143
| | | | | | | | | | | | | | | | | | | | | | | | The network and address fields were sometimes truncated for netstat -i without -W, and often much too wide for netstat -i with the -W option. Fields such as normal packet counts often overflowed. As a result, columns didn't line up, and large white spaces made it harder to follow a line across the display. Change the code to compute the required field sizes for network, address, and various packet counts. Hoist the code to format network and address into a subroutine that can be called twice, once to measure the required field widths, and once to emit the values. Use separate field widths for input and output packets, byte counts, and error and drop counters. These are left at defaults (the preceding values) with the -h option, in which case the fields have a limited total width. An extra space is included between the Network and Address, which otherwise seemed too close. Change the mention of -W with -i in the man page to say that most field widths are computed dynamically in this case. MFC after: 1 week Reviewed by: sjg, glebius Differential Revision: https://reviews.freebsd.org/D41160
* base: Remove support for the VTOC8 partitioning schemeMarius Strobl2023-07-263-116/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The removal of the sparc64 support in February 2020 obsoleted the VTOC8 partitioning scheme as no other FreeBSD platform makes use of it. Moreover, the code is bitrotting as nothing defines e. g. LOADER_VTOC8_SUPPORT any more and, thus, should go now, too. With this change, the following commits are reverted as far as VTOC8 is concerned and parts haven't already previously been deleted along with prior sparc64 removals: 094fcb157d4c98211899cf09d06e2cf19149b7e0 a7d366e9589c95feda6f3bc78c59c6355d51f126 ba8d50d08b9df4e8213f9a6997ff6792ecebcd9b The alignment example d9711c28efc4ec89ba5ea11f8fd63e9d0a7fc81b added to the VTOC8 section of gpart.8 is folded into the MBR one. This should finally conclude the deorbit of sparc64-specific bits. We had joy, we had fun we ran Unix on a Sun. But that source and the song of FreeBSD have all gone. Credits to Michael Bueker for the original "Unix on a Sun" and Rod McKuen for the "Seasons in the Sun" lyrics.
* Move LIBADD lines from usr.bin/clang/*/Makefile one level upDimitry Andric2023-07-2326-67/+4
| | | | | | | | | Some utilities under usr.bin/clang were only linked to libz, while most others were linked to libz and libzstd. Make this consistent, and remove repetition, by moving these LIBADD lines to usr.bin/clang/clang.prog.mk and usr.bin/clang/clang.prog.mk. MFC after: 3 days
* seq: style(9) cleanupEd Maste2023-07-211-16/+15
| | | | | | This is in part for diff reduction with OpenBSD. Sponsored by: The FreeBSD Foundation
* unifdef: Fix case where a multiline comment follows a directive.Dag-Erling Smørgrav2023-07-193-2/+26
| | | | | | Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D41026