aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
Commit message (Collapse)AuthorAgeFilesLines
...
* | | lockf: add a -p mode to write the child's pidKyle Evans2025-07-102-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | If we're going to hold the lock, it can be useful to scribble down the pid that we spawned off to quickly associate the lock back to the process that's keeping it open. Reviewed by: allanjude (previous version), des Differential Revision: https://reviews.freebsd.org/D51014
* | | truncate.1: Polish title and examplesAlexander Ziaee2025-07-091-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + describe better + switch examples to human readable sizes, with consistent spacing + `Downsize ... in 5 Megabytes` >> `Downsize ... by 5 Megabytes` + remove prompt from lone example with prompt for consistency + remove x permissions from kernel example + examples now fit on standard console without wrapping While here: + fold a line to eliminate linter warning + tag spdx + add -nosplit to AUTHORS to eliminate a rendering glitch MFC after: 3 days Discussed with: asomers, jhb, maxim Reviewed by: imp (previous version) Closes: https://github.com/freebsd/freebsd-src/pull/1568
* | | mkimg: Make output reproducible using a specific timestampMark Johnston2025-07-075-18/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In commit 95ac5b0e27e9 ("mkimg: Add a reproducible mode"), I added a -R flag to mkimg, indicating that output should be reproducible. There is one place in the VHD image backend that uses time(3) to populate an image metadata field; this field is visible to tools which know how to process VHD images. Rather than picking an arbitrary value for that timestamp, it seems better to behave like makefs(8) and let the invoker pick a suitable timestamp. So, remove -R and instead add a -t option which lets the timestamp be specified directly. Then, modify the VHD backend to use that timestamp. Fixes: 95ac5b0e27e9 ("mkimg: Add a reproducible mode") Reviewed by: bnovkov MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D51077
* | | clang: install clang-scan-depsLexi Winter2025-07-063-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang-scan-deps is used to generate dependency information from C++20 modules according to proposed standard ISO/IEC WG21 P1689R5[0]. It is required by common build tools (e.g., CMake) to build C++ sources that use modules. Since this is a core build tool, install it by default, not gated behind MK_CLANG_EXTRAS. [0] https://www.open-std.org/JTC1/SC22/WG21/docs/papers/2022/p1689r5.html MFC after: 3 days Reviewed by: kevans, dim Approved by: kevans (mentor) Requested by: jbo Differential Revision: https://reviews.freebsd.org/D51044
* | | sockstat: microoptimize cap-getnameinfoAlan Somers2025-07-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert a change to the cap_getnameinfo, accidentally introduced in 0726c6574f8, that caused cap_getnameinfo to populate a buffer which was about to be thrown away. Fixes: 0726c6574f889507e5030173bf4c82c80911394d Sponsored by: ConnectWise Reviewed by: Damin Rido <rido@FreeBSD.org> Pull Request: https://github.com/freebsd/freebsd-src/pull/1753
* | | procstat: Add handling for inotify descriptorsMark Johnston2025-07-042-0/+12
| | | | | | | | | | | | | | | MFC after: 3 months Sponsored by: Klara, Inc.
* | | kdump: Add support for decoding inotify eventsMark Johnston2025-07-041-0/+21
| | | | | | | | | | | | | | | | | | | | | These are emitted when reading from an inotify descriptor. MFC after: 3 months Sponsored by: Klara, Inc.
* | | truss: Add a decoder for inotify_add_watch_at(2)Mark Johnston2025-07-042-1/+7
| | | | | | | | | | | | | | | MFC after: 3 months Sponsored by: Klara, Inc.
* | | Merge bmake-20250618Simon J. Gerraty2025-06-282-20/+17
|\| |
* | | sockstat: Add automatic column sizing and remove -w optionDamin Rido2025-06-272-236/+392
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor sockstat to dynamically size table columns based on content. This eliminates the need for the -w option, which is now ignored for backwards compatibility. Numeric columns are now right-aligned for improved readability; previously, they were left-aligned. Unknown fields are now consistently shown as "??" instead of a mix of "", "?", and "?" for output uniformity. Sponsored by: Google, LLC (GSoC 2025) MFC after: 2 weeks Reviewed by: asomers Pull Request: https://github.com/freebsd/freebsd-src/pull/1720
* | | mkimg: Add a reproducible modeMark Johnston2025-06-264-16/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mkimg embeds a UUID in the GPT header and uses the current time of day to generate it, so its output is not reproducible by default. Add a -R flag to ask it to use a fixed time for UUID generation. Merge the FreeBSD-specific implementation of osdep_uuidgen() with that of Linux, as the use of uuidgen(2) is incompatible with reproducible output mode. Reviewed by: bnovkov MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D49716
* | | libc: Rename fscandir{,_b}() to fdscandir{,_b}().Dag-Erling Smørgrav2025-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This seems to fit the pattern better (e.g. fdopendir()). I've added weak references to ease the transition, but since it's only been a few days, we can remove them (and the ObsoleteFiles entries for the manual pages) before we branch stable/15. Fixes: deeebfdecab5 Sponsored by: Klara, Inc. Reviewed by: kevans Differential Revision: https://reviews.freebsd.org/D50980
* | | mididumpl.1: update link to Standard MIDI-File Format Spec. 1.1, updatedWolfram Schneider2025-06-231-1/+1
| | | | | | | | | | | | | | | PR: 287588 MFC after: 1 week
* | | localedef: Fix a wchar_t comparisonMark Johnston2025-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The intent here is to characterize wide characters which fit in a single byte. When wchar_t is signed, this comparison is insufficient. On systems with signed wchar_t, of the files in /usr/share/locale this only affects zh_CN.GB18030/LC_COLLATE. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50757
* | | localedef: Use consistent sorting orderMark Johnston2025-06-204-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In several modules we build up an RB tree keyed by wide characters. wchar_t has different signedness on different platforms, so iteration over such a tree results in platform-dependent ordering. The ctype module uses this ordering when writing the output file, which creates reproducibility problems when comparing the results of cross builds and native builds (e.g., native amd64 vs. cross-building on arm64). Modify such comparisons to always be unsigned. Introduce a helper function for this purpose. In the other modules I believe the sort order does not affect program output. On systems with signed wchar_t, of the files in /usr/share/locale this only affects zh_CN.GB18030/LC_CTYPE. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50756
* | | diff: Fix gcc build.Dag-Erling Smørgrav2025-06-201-3/+3
| | | | | | | | | | | | Sponsored by: Klara, Inc.
* | | diff: Whitespace nits.Dag-Erling Smørgrav2025-06-201-13/+13
| | | | | | | | | | | | Sponsored by: Klara, Inc.
* | | diff: Detect loops when diffing directories.Dag-Erling Smørgrav2025-06-202-10/+92
| | | | | | | | | | | | | | | | | | Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D50936
* | | truss.1: Reference sysdecode(3)Mateusz Piotrowski2025-06-181-2/+3
| | | | | | | | | | | | MFC after: 1 week
* | | ps(1), top(1): Priority: Let 0 be the first timesharing levelOlivier Certner2025-06-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the origin from PZERO to PUSER. Doing so allows users to immediately detect if some thread is running under a high priority (kernel or realtime) or under a low one (timesharing or idle). MFC after: 1 month Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation
* | | beep: CapsicumizeEd Maste2025-06-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While it's unlikely that beep(1) will be used in a context where a sandbox is particularly valuable, it does offer a simple demonstration of entering a capability sandbox after opening required fds, and is trivial to do. Reviewed by: christos Event: Kitchener-Waterloo Hackathon 202506 Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D50709
* | | tcp: count two previously ignored kinds of syncookie failuresGleb Smirnoff2025-06-171-1/+5
| | | | | | | | | | | | | | | Reviewed by: tuexen Differential Revision: https://reviews.freebsd.org/D50899
* | | Don't include netinet/tcp_timer.h when not neededMichael Tuexen2025-06-173-3/+0
| | | | | | | | | | | | | | | | | | | | | Reviewed by: glebius MFC after: 1 week Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D50889
* | | dtc: Sync with upstream commit 23387ddJose Luis Duran2025-06-162-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add the ability to parse char literals needed to compile DTBs currently in base. Reviewed by: theraven, emaste Approved by: emaste (mentor) Differential Revision: https://reviews.freebsd.org/D42438
* | | telnet: Add Support for MIT KRB5 buildCy Schubert2025-06-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MIT KRB5 does not support telnet. This is because telnet uses 3DES encryption, which requires 3DES encrypted keys in the KDC database. As MIT had deprecated and removed 3DES support about a decade ago, telnet is not supported. Sponsored by: The FreeBSD Foundation Reviewed by: markj Differential revision: https://reviews.freebsd.org/D50785
* | | compile_et: The Heimdal compile_et is not needed with MIT KRB5Cy Schubert2025-06-161-0/+2
| | | | | | | | | | | | | | | | | | MIT KRB5 provides its own compile_et, built by krb5/util/compile_et. Sponsored by: The FreeBSD Foundation
* | | fstat: identify kqueue, mqueue, and procdesc file descriptorsAlan Somers2025-06-131-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When displaying kqueue, mqueue, and procdesc file descriptors, identify them as such. There aren't any details, but it's better than a scary warning like "unknown file type 15 for file 6 of pid 26393". Sponsored by: ConnectWise Differential Revision: https://reviews.freebsd.org/D48706 MFC after: 2 weeks
* | | fstat: Use POSIX str2sig(3)Ricardo Branco2025-06-111-31/+3
| | | | | | | | | | | | | | | Reviewed by: imp, kib, des, jilles Pull Request: https://github.com/freebsd/freebsd-src/pull/1696
* | | su.1: refer to mdo(1) and improve manual syntaxTom Hukins2025-06-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | Running `mandoc -Tlint usr.bin/su/su.1` spotted the syntax problem. Reviewed by: imp, ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1712 Closes: https://github.com/freebsd/freebsd-src/pull/1712
* | | mdo.1: Describe this command's historyTom Hukins2025-06-111-1/+6
| | | | | | | | | | | | | | | Reviewed by: imp, ziaee Pull Request: https://github.com/freebsd/freebsd-src/pull/1712
* | | diff: minor fixes to manual pagePau Amma2025-06-061-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | * Add missing dash before long option name in synopsis. * Remove spurious paragraph break and bullet item. * While there, fix mandoc -T lint complaints. Reviewed by: ziaee, des Differential Revision: https://reviews.freebsd.org/D48388
* | | ktrace: trace and decode thr_new() thr_paramKonstantin Belousov2025-06-041-0/+21
| | | | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation MFC after: 1 week
* | | kdump: nicer printing of kill(2) PID argumentKyle Evans2025-06-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to wait*(), kill(2) operates on a pid that currently gets output as hex. Output it in decimal to make it a little easier to eyeball the pid we're signalling. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D50508
* | | kdump: nicer printing of wait*() ID argumentsKyle Evans2025-06-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, both of these will print pid/uid/gid/sid/jid in hex, which isn't very helpful for eyeballing. Align more closely with truss(1) and print these in decimal instead. `ip` is likely wider than our ID type, so we do a small casting trick in wait4(2) to get it sign-extended and rendered properly. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D50496
* | | kdump(1): Use static array for header types string literalsKonstantin Belousov2025-06-031-49/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also change sprintf() to snprintf(). Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633
* | | kdump: staticise functions in kdump.cKonstantin Belousov2025-06-031-66/+66
| | | | | | | | | | | | | | | | | | | | | Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633
* | | kdump(1): pretty-print KTR_EXTERRKonstantin Belousov2025-06-031-0/+18
| | | | | | | | | | | | | | | | | | | | | Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633
* | | ktrace(1): teach about KTR_EXTERRKonstantin Belousov2025-06-033-2/+8
| | | | | | | | | | | | | | | | | | | | | Reviewed by: brooks Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D50633
* | | libarchive: merge from vendor branchMartin Matuska2025-06-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libarchive 3.8.1 New features: #2088 7-zip reader: improve self-extracting archive detection #2137 zip writer: added XZ, LZMA, ZSTD and BZIP2 support #2403 zip writer: added LZMA + RISCV BCJ filter #2601 bsdtar: support --mtime and --clamp-mtime #2602 libarchive: mbedtls 3.x compatibility Security fixes: #2422 tar reader: Handle truncation in the middle of a GNU long linkname CVE-2024-57970 #2532 tar reader: fix unchecked return value in list_item_verbose() CVE-2025-25724 #2532 unzip: fix null pointer dereference CVE-2025-1632 #2568 warc: prevent signed integer overflow #2584 rar: do not skip past EOF while reading #2588 tar: fix overflow in build_ustar_entry #2598 rar: fix double free with over 4 billion nodes #2599 rar: fix heap-buffer-overflow Important bugfixes: #2399 7-zip reader: add SPARC filter support for non-LZMA compressors #2405 tar reader: ignore ustar size when pax size is present #2435 tar writer: fix bug when -s/a/b/ used more than once with b flag #2459 7-zip reader: add POWERPC filter support for non-LZMA compressors #2519 libarchive: handle ARCHIVE_FILTER_LZOP in archive_read_append_filter #2539 libarchive: add missing seeker function to archive_read_open_FILE() #2544 gzip: allow setting the original filename for gzip compressed files #2564 libarchive: improve lseek handling #2582 rar: support large headers on 32 bit systems #2587 bsdtar: don't hardlink negative inode files together #2596 rar: support large headers on 32 bit systems #2606 libarchive: support @-prefixed Unix epoch timestamps as date strings #2634 tar: Support negative time values with pax #2637 tar: Keep block alignment after pax error #2642 libarchive: fix FILE_skip regression #2643 tar: Handle extra bytes after sparse entries #2649 compress: Prevent call stack overflow #2651 iso9660: always check archive_string_ensure return value CVE: CVE-2024-57970, CVE-2025-1632, CVE-2025-25724 PR: 286944 (exp-run, 3.8.0) MFC after: 2 weeks
* | | atf, kyua: Implement require.kmods.Dag-Erling Smørgrav2025-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a metadata variable, require.kmods, and corresponding functions or methods in C, C++, and shell, which allow a test to specify that it requires particular kernel modules to run. If the kernel modules are not present, the test is skipped. One might want to consider a kyua option which makes it attempt to load the modules instead. Differential Revision: https://reviews.freebsd.org/D47470
* | | mail: tests: reset signal disposition before testingKyle Evans2025-05-291-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a good citizen of the OS, mail(1) won't try to catch signals that were ignored when it started and it won't reconfigure its signal mask unless it's going to try and handle a signal. The test should start mail(1) off in a well-known state for the signal that it's trying to test in order to get the behavior that's desired. No functional change, just improves the resilience of the test. Reviewed by: des Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50599
* | | mail: don't rewrite buffer sizes as muchKyle Evans2025-05-293-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Thes buffers are arrays with a known size, just use sizeof() rather than rewriting their sizes -- no functional change, slightly more resilient against future possible errors. Reviewed by: markj Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D50582
* | | move ch{own,grp}(8) and tee(1) to FreeBSD-runtimeLexi Winter2025-05-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | chown and chgrp are almost essential for system management; in particular, a lot of rc.d scripts rely on them. tee is quite commonly used in shell scripts, and is small enough that there's no real need for it to be in -utilities. PR: 287014 Reviewed by: dch, manu, des, emaste Approved by: des (mentor) Differential Revision: https://reviews.freebsd.org/D50497
* | | packages: rename elftoolchain to toolchain, add more thingsLexi Winter2025-05-2820-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename the existing "elftoolchain" package to "toolchain", and move everything which is gated by MK_TOOLCHAIN (e.g. lex, yacc, ...) to the toolchain package. This means we have one package called "toolchain" which contains all the development-related utilities which are not compilers or already part of some other package (e.g., llvm). Reviewed by: des, emaste Approved by: des (mentor) Differential Revision: https://reviews.freebsd.org/D50286
* | | packages: move ctl{d,stat,adm} to the ctl packageLexi Winter2025-05-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This leaves the iscsi package for the iSCSI initiator, and the new package provides the CAM target layer (including the iSCSI target). Reviewed by: manu, des, jhb Approved by: des (mentor) Differential Revision: https://reviews.freebsd.org/D50287
* | | Add ts(1) commandJuraj Lutter2025-05-272-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add /usr/bin/ts, a command that timestamps each line of its stdin before it is being printed to stdout. A typical use case is to profile shell scripts. Obtained from: OpenBSD 7.2 Relnotes: yes Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D35694
* | | systat/top: Update ZFS sysctl namesAlexander Motin2025-05-252-6/+6
| | | | | | | | | | | | | | | | | | | | | Some of ARC statistic sysctls changed years ago, but those tools are still using legacy shims, that are going to be removed. MFC after: 3 days
* | | m4: Fix OOB access displaying MIN_INTEric Blake2025-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Previously displaying INT_MIN resulted in an out of bounds access to digits[-8]. In twos-complement -INT_MIN is still negative. PR: 287013 Reviewed by: emaste
* | | m4: Allow empty base argument in eval()Eric Blake2025-05-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | POSIX specifies "The second argument, if specified, shall set the radix for the result; if the argument is blank or unspecified, the default is 10." Previously we reported an invalid PR: 287015 Reviewed by: emaste
* | | primes: put an additional commentMaxim Konovalov2025-05-201-0/+4
| | |