This flag is used in field 'cr_flags', which is never directly visible
outside the kernel. That field is however exported through 'struct
kinfo_proc' objects (field 'ki_cr_flags'), either from the kernel via
sysctls or from libkvm, and is supposed to contain exported flags
prefixed with KI_CRF_ (currently, KI_CRF_CAPABILITY_MODE and
KI_CRF_GRP_OVERFLOW, this second one being a purely userland one
signaling overflow of 'ki_groups').
Make sure that KI_CRF_CAPABILITY_MODE is the flag actually exported and
tested by userland programs, and hide the internal CRED_FLAG_CAPMODE.
As both flags are currently defined to the same value, this doesn't
change the KBI, but of course does change the KPI. A code search via
GitHub and Google fortunately doesn't reveal any outside uses for
CRED_FLAG_CAPMODE.
While here, move assignment of 'ki_uid' to a more logical place in
kvm_proclist(), and definition of XU_NGROUPS as well in 'sys/ucred.h'
(no functional/interface changes intended).
Reviewed by: mhorne
Approved by: markj (mentor)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46909
(cherry picked from commit 09290c3a0c82524138973b14f393379edf733753)
A ports exp-run (PR 283410) showed one port to be affected
(sysutils/procs), which has been fixed upstream and in the ports tree.
All additional indirect references to CRED_FLAG_CAPMODE we found after
the code search mentioned in the original commit message are
automatically generated from our headers by FFI mechanisms, so
automatically disappear at recompilation (and the KBI is not changed, as
explained above, so recompilation is not needed).
AFMT_FLOAT is supported by sound(4) as of FILLME, so use it here, since
the whole program works with floats already.
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D47639
(cherry picked from commit 1166cfd96f3403edb082387fbc3a4d4aa249bce8)
As this is the only system call that MAC/do currently supports, and the
only one that really can be for transitions involving simultaneous
changes of user and group IDs.
Reviewed by: bapt
Approved by: markj (mentor)
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D47621
(cherry picked from commit e395e354823b690ba19ecc8e3688bacec6f67ad3)
strings(1) is not conditional on WITH_/WITHOUT_TOOLCHAIN, as it is a
small utility that is also useful outside of the toolchain context.
As of commit 1cae7121c667 we switched to WITH_LLVM_BINUTILS by default.
After this change building world with default options but installing
WITHOUT_TOOLCHAIN failed, because we would build LLVM's strings but
attempt to install ELF Tool Chain's version, which did not exist.
Address this by always including ELF Tool Chain strings in non-install
make targets, so that it will be available if options are changed at
install time.
PR: 285556
Reported by: Michael Butler
Reviewed by: brooks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49425
(cherry picked from commit fdc4db57224ce19b867c60fce4c410068be40c27)
If the `setlocale()` call fails, emit a warning and sleep briefly so the
user has a chance to see the warning before we redraw the screen. Note
that we have no way of knowing exactly what is wrong, but at least we
can suggest that they check their environment.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D49230
(cherry picked from commit 180065eb09e699820a1e1c45d3d00156e0effe29)
Switching between io and cpu sorting uses a great example in the usage.
[-m io | cpu]. Use that everywhere.
MFC after: 3 days
Reviewed by: mhorne
Approved by: mhorne (mentor)
Differential Revision: https://reviews.freebsd.org/D49515
(cherry picked from commit 187d954eab94fdcb33609d91966dbd727acfd720)
Organize key bindings by ascii(7) for consistency and maintainability,
mark them as Interactive Commands, wordsmith them, and sync their
organization between the manual and help screen.
MFC after: 3 days
PR: 282734
Fixes: c8aa5e526 (move command mapping to commands.c)
Reviewed by: imp, mhorne, Jim Brown <jpb@jimby.name>
Approved by: mhorne (mentor)
Differential Revision: https://reviews.freebsd.org/D49462
(cherry picked from commit 0a85254d5a33800600477ce57fbaab64591aa6ea)
Printing the file name doesn't make sense since mkstemp failing means
that the file wasn't created.
Also add a test case for this.
Co-authored-by: Jose Luis Duran <jlduran@gmail.com>
Reviewed by: imp,jhb
Pull Request: https://github.com/freebsd/freebsd-src/pull/1383
(cherry picked from commit e8d027be6b84ac976eacd46283c286b934dd6f1f)
+ correct misfile in section 8
+ rewrite the document descirption to include -9660
+ markup command modifiers as such instead of bold
+ markup variables as defined variables, enabling apropos
+ correct option syntax in description section
+ unwrap list offsets for legibility
+ fix line wrapping for standard BSD console
+ crossreference cd9660(5) and vis versa
+ tag SPDX for both manuals
MFC after: 3 days
Reviewed by: mhorne
Approved by: mhorne (mentor)
Differential Revision: https://reviews.freebsd.org/D48513
(cherry picked from commit 283be95ea29abd7f867e4084bafe368c47f6c038)
Notably:
* spell "Megabytes" as "megabytes" consistently;
* remove a stray asterisk from the /boot/kernel/kernel listing
* avoid using a shell prompt in the examples consistently
* fixes the size parameter
* add an example how to increase the file size
PR: 273997
MFC after: 1 week
(cherry picked from commit 5460bdda9d4cb3ce1d7431824b6f53c545888b53)
I very occasionally see test failures caused by the total CPU time being
several milliseconds under 3s. The test runs "limits -t 3 time <busy
loop>" and verifies that the reported time elapsed is at least 3s (and
not too much more). In particular, any time spent executing time(1)
itself is counted against the limit but not recorded in the output.
I think it makes more sense to reverse the order, so that the CPU time
limit is not applied to time(1) itself. This also resolves the test
failures I was seeing, which were reproducible only under load (i.e.,
running many tests in parallel).
MFC after: 2 weeks
Sponsored by: Klara, Inc.
(cherry picked from commit 0f63c4af5e4761680550b0aa08cc96f52076c08c)
This uses DES and it's likely that nobody uses that in 2025.
If somebody uses this we help them by deprecating and removing this.
Reviewed by: bapt, emaste
Differential Revision: https://reviews.freebsd.org/D30682
(cherry picked from commit 723425f837270dd3b22098168ae9464a1ebe38c6)
findsym() is intended for use while parsing input, so it should not be
called from addsym2() or indirectsym(), which are called before any
input is processed.
MFC after: 1 week
Sponsored by: Klara, Inc.
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D48733
(cherry picked from commit c63af363c2458aebc30c01cd0b93b4b902580019)
install's -o and -g flags both accept a name or a numeric argument.
In -U -M (non-root METALOG) mode it always emitted uname= and gname= in
the METALOG, but these are not appropriate for numeric IDs.
If the -o and/or -u arguments parse as an ID, emit uid= and/or gid=
respectively.
Note that if an argument is valid as both a name and numeric ID we will
prefer the name in normal (non -U -M) mode and the ID in -U -M mode. We
don't want to require a passwd db in non-root mode, and entirely-numeric
user or group names are a terrible idea so just accept this discrepancy.
PR: 284119
Reviewed by: jlduran
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D48504
(cherry picked from commit 4b04f5d7e8a2bb0488ad5804ecaf45cef5b1d46f)
vtfontcvt requires that all glyphs are 1x or 2x a common width,
reporting for example "bitmap with unsupported DWIDTH 27 0 on line xxx"
if the font is expected to be 32 pixels wide.
Add the expected / permitted values to the error message to make the
issue more clear - for the same example,
"bitmap with unsupported DWIDTH 27 0 (not 32 or 64)".
Reviewed by: ziaee
Sponsored by: The FreeBSD Foundation
(cherry picked from commit 3433daae0d20d55503084c4d17b8a3e685657ad2)
People are often stunned by robust manual search functionality on
the community discord, so improve introductory doc regarding search by:
+ explain what search related flags do instead of using similies
+ consolidate and standardize search options in synopsis and usage
+ mention that a page or file can be specified in synopsis and example
+ call regular expressions `expression`, which searches to re_format(7)
+ crossreference the regular expression manual instead of egrep(1)
+ improve MANPATH xref flow and explanation, matching MAILPATH in sh(1)
+ mark up aditional semantics for their inclusion in apropos
While here:
+ use consistent spacing and form (Ql) for quoted literals
+ clean a few linter errors regarding self xref and nospace
+ reset a list width to indent for consistency with style.mdoc
+ tidy examples + align files + tag spdx
Outstanding:
- example 3 shows no results on a typical bsdinstall'd system
MFC after: 3 days
Reviewed by: elliejs, emaste, imp, Jessica Hawkwell, jlduran
Approved by: imp
(cherry picked from commit 46a9fb7287f41eedf321d81a68a826f231d11bfe)
Based on the test case from PR 271817 by Mohamed Akram.
PR: 271817
MFC after: 2 weeks
(cherry picked from commit 003818aca4cdda47adef808a56d48003aa514029)
The "c" command should start the next cycle as clarified in POSIX 2024.
This is also consistent with historical and gnu sed behavior.
This patch is from OpenBSD by way of NetBSD with a tweak to the man page
date by me.
Confirmed the test case in the bug now works.
PR: 271817
Obtained from: NetBSD (1.39 uwe), OpenBSD (1.39 millert)
Sponsored by: Netflix
(cherry picked from commit a2d78713171cf138b5ae50d61f82df1af7574c95)
In preparation for more arguments, switch bintrans qp argument parsing
to getopt_long, while here make the decodign argument being -d|--decode
for compatibility with base64 encoding/decoding
MFC After: 1 week
Reviewed by: pstef
Differential Revision: https://reviews.freebsd.org/D48380
(cherry picked from commit a8d9bd3fa5855fe7583ed05946296ab6b9937d69)
Otherwise there is no specific -t option which captures struct arrays.
MFC after: 1 week
(cherry picked from commit 596ee234ef4537e71f030e13598ecbe73ee697bb)
The shar(1) program is simple, but the fundamental idea of a sh archive
is risky at best and one that we probably shouldn't be promoting as
prominently as a program in $PATH and a manpage. Let's deprecate and
remove it, since the same functionality can easily be found in
tar(1) instead.
Reviewed by: emaste, philip
Reviewed by: allanjude, brooks, delphij, des, imp, rpokala (previous)
(cherry picked from commit f68ee0e7a1e8732f725cad4ac708ec49093782d4)
(cherry picked from commit 2832af7b4ea256b18ef4dbf2ff97a50765f0609a)
Preserve over 40 years of "call UNIX" BSD heritage
while answering "one line about what it does" e.g.
"how do I get a serial console?"
"% apropos serial"
MFC after: 3 days
Reported by: imp
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1423
(cherry picked from commit 4d12c7b9df660b15580ff3b07ef5570d1cab958a)
This was made conditional to support cross-builds, but the relevant
header wasn't included so it was never enabled for native builds.
PR: 278124
Fixes: c3a6ea5ba6 Allow compiling usr.bin/find on Linux and Mac
(cherry picked from commit 984add354edef8a6b4983a33f89ff62532a1556b)