Commit graph

277200 commits

Author SHA1 Message Date
Dag-Erling Smørgrav
b9e32d8c8f Clean up botched merge.
Fixes:		6895133fe2
2024-04-04 14:07:00 +02:00
Dag-Erling Smørgrav
6895133fe2 lorder: Clean up and improve robustness.
* Properly parse (no) command-line options.

* Ensure that errors go to stderr and result in a non-zero exit.

* Drop the special-case code for a single argument, as it will produce
  the wrong outcome if the file does not exist or is corrupted.

* Don't print anything until after we've collected all the data.

* Always create all temporary files before setting the trap.  This
  ensures that the trap can safely fire at any moment, regardless of any
  previous definition of `T`.

* Use a temporary file rather than a pipe between `nm` and `sed` to
  ensure proper termination if `nm` fails due to a missing or invalid
  input.

* The check for self-referential entries was conditional on testing our
  argument list against a regex looking for archives.  This was a
  needless and unreliable optimization; make the check unconditional.

* Document that lorder will not work properly if any of its inputs have
  spaces in their name.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D44133

(cherry picked from commit 5c7b986c21)

lorder: Add unit tests.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D44134

(cherry picked from commit 96da41b6db)

lorder: Undeprecate.

While lorder is not required by our current toolchain (or any toolchain
we've used in the past decade or two), it still occasionally shows up
in build systems of third party software, including The Open Group's
UNIX conformance test suite, and the maintenance cost is negligible.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	imp, allanjude, emaste
Differential Revision:	https://reviews.freebsd.org/D44135

(cherry picked from commit cf4d9bf8b3)

lorder: Don't rely on legacy syntax.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D44155

(cherry picked from commit aedb37dc49)

lorder: Tweak invalid file test.

Different implementations of `nm` have different ways of telling you
that your file is not a valid object or library, but they all seem to
have “not recognized” as a common substring.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D44154

(cherry picked from commit aa80cfadff)

usr.bin: Make lorder conditional on MK_TOOLCHAIN.

MFC after:	1 week
Reviewed by:	allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D44558

(cherry picked from commit 125c4560bc)
2024-04-04 11:55:25 +02:00
Dag-Erling Smørgrav
8934e4a17e install: Prefer strsnvis() to strsvis().
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D44514

(cherry picked from commit 2cab4be46b)
2024-04-04 11:51:06 +02:00
Dag-Erling Smørgrav
f862c31a41 ln: Use stdbool, style nits.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	imp, allanjude
Differential Revision:	https://reviews.freebsd.org/D44511

(cherry picked from commit 437d53daf7)

ln: Clean up and simplify tests.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D44512

(cherry picked from commit e0afcbc856)

ln: Add a test case for ln -sfF.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude, asomers
Differential Revision:	https://reviews.freebsd.org/D44513

(cherry picked from commit 2ae8d34666)
2024-04-04 11:51:05 +02:00
Dag-Erling Smørgrav
fc72874563 touch: Allow setting the timestamp to -1.
Note that VFS internally interprets a timestamp of -1 as “do not set”,
so this has no effect, but at least touch won't incorrectly reject the
given date / time (1969-12-31 23:59:59 UTC) as invalid.

While here, fix some style issues.

MFC after:	1 week
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D44504

(cherry picked from commit aa69e0f212)

touch: Add unit tests.

MFC after:	1 week
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D44505

(cherry picked from commit 74a4aa9b15)
2024-04-04 11:51:04 +02:00
Dag-Erling Smørgrav
662dc74155 tzcode: Clean up the ctime(3) manual page.
MFC after:	3 weeks
Sponsored by:	Klara, Inc.
Reviewed by:	pauamma_gundo.com
Differential Revision:	https://reviews.freebsd.org/D39714

(cherry picked from commit 6f3c2f41b1)

libc: Improve description of mktime() / timegm().

* Mention that mktime() and timegm() set errno on failure.
* Correctly determining whether mktime() / timegm() succeeded with
  arbitrary input (where -1 can be a valid result) is non-trivial.
  Document the recommended procedure.

PR:		277863
MFC after:	1 week
Reviewed by:	pauamma_gundo.com, gbe
Differential Revision:	https://reviews.freebsd.org/D44503

(cherry picked from commit 7534109d13)
2024-04-04 11:51:02 +02:00
Dag-Erling Smørgrav
16349f296b Update tzcode to 2024a.
MFC after:	3 weeks
Sponsored by:	Klara, Inc.

(cherry picked from commit 46c599340f)
2024-04-04 11:47:10 +02:00
Konstantin Belousov
bfafc6a86d thread_single(9): decline external requests for traced or debugger-stopped procs
(cherry picked from commit 9241ebc796)
2024-04-04 05:43:56 +03:00
Ka Ho Ng
c89889b9c3 libfetch: parse scheme://domain:/ correctly
This improves URL-parsing compability with cURL, and unbreaks parsing of
similar kinds of URLs after commit 8d9de5b10a.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	des
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44493

(cherry picked from commit fb860ed0c5)
2024-04-03 15:12:38 -04:00
Zhenlei Huang
223077d0a8 kern linker: Make linker_file_add_dependency() void
The only possible return value has been zero since cee9542d51.

No functional change intended.

Reviewed by:	dfr
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44507

(cherry picked from commit 1c7307cf67)
(cherry picked from commit 41d9d301fb)
2024-04-03 14:26:57 +08:00
Cy Schubert
0fb7c4a38c hostapd: Work around lack of MLME support
hostap MLME uses Linux data structures and definitions not available
in FreeBSD. The ability for hostapd to select the frequency (channel)
depends Linux MLME, though strictly it's not required. Work around the
Linux MLME requirement to configure device frequency.

The detailed description is: hostapd will only set the channel (frequency)
when Linux MLME is configured. Enabling NEED_AP_MLME will result in
numerous build errors due do Linux data structures and definitions not
available under FreeBSD. The code to set the frequency from the selected
channel is only within the NEED_AP_MLME code path because without MLME,
hostapd_get_hw_features() is an inline that always returns -1 whereas with
MLME hostapd_get_hw_features() will obtain hardware features from the
kernel. Until such time we simply set the frequency as configured.

PR:		276375

(cherry picked from commit 84ed86380a)
2024-04-02 17:29:13 -07:00
Colin Percival
853241218d release.sh: Don't install git if already present
Prior to this commit, we install git from ports if there is a ports
tree available and git is not installed, and we install git from pkg
otherwise -- including the case where git is already installed.

Rework the logic to not (re)install git at all if it is already
installed.

MFC after:	3 days

(cherry picked from commit 6baddb6b11)
2024-04-02 13:44:46 -07:00
Konstantin Belousov
b79fb02b32 x86: handle MXCSR from XSAVEOPT when x87 state was optimized
PR:	275322

(cherry picked from commit 1c091d1126)
2024-04-02 18:18:00 +03:00
Konstantin Belousov
c787fedf12 amd64: initialize td_frame stack area for init(8) main thread
(cherry picked from commit e0c92dd2b7)
2024-04-02 18:18:00 +03:00
Konstantin Belousov
d4676f565d x86: test the right CPUID bit when checking for XSAVEOPT support
(cherry picked from commit 960d151eaa)
2024-04-02 18:18:00 +03:00
Ed Maste
51b2556ee6 bsdlabel: add BUGS section documenting 8 partition limit
PR:		276517
(cherry picked from commit 7dc5c6c412)
(cherry picked from commit 9f9289901c)
2024-04-02 09:58:37 -04:00
Bjoern A. Zeeb
465e5f1b8b ath_hal/ar9300: allow JUPITER cards to read eeprom
In ar9300_eeprom_read_word() also allow JUPITER cards read the eeprom
instead of returning an error.  While this will not help all the
9462, 9485, 9565 OEM cards to work, it will make debugging of the
next steps a lot easier.

While here fix a typo in the error message if we do not get CAL.

PR:		255337
Tested by:	John Nielsen (john jnielsen net)
Reviewed by:	adrian
Differential Revision: https://reviews.freebsd.org/D44328

(cherry picked from commit f254aad33d)
2024-04-01 23:52:40 +00:00
Michael Osipov
fc5208028a freebsd-update: mark "cron" as fetched as "fetch" itself
The change in 33bd05c318 was incomplete
because it did not mark "cron" as ISFETCHED=1 although it performs the
same operations as "install", but less output and does not perform a
hard exit. Mark result as such and make "install" know that updates have
been fetched.

PR:		277699
Approved by:	jrm (mentor), emaste, cperciva
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D44356
2024-04-01 21:19:50 +02:00
Kristof Provost
e0a58ef24a pfsync: cope with multiple pending plus messages
It's possible for pfsync to add a plus message when one is already queued.
Append both, rather than overwriting the already pending one.

MFC after:	1 week

(cherry picked from commit caccf6d3c0)
2024-04-01 09:33:36 +02:00
Kristof Provost
0ade521bac pfsync: fix use of invalidated stack variable
Calls to pfsync_send_plus() pass pointers to stack variables.
If pfsync_sendout() then fails it retains the pointer to these stack
variables, accesing them later.

Allocate a buffer and copy the data instead, so that we can retain the
pointer safely.

Reported by:	CI KASAN, markj
MFC after:	1 week

(cherry picked from commit 81debbd60e)
2024-04-01 09:33:36 +02:00
Rick Macklem
23a48a469a nfsd.8: Document ways to minimize Copy operation times
For NFSv4.2, a Copy operation can take a long time to complete.
If there is a concurrent ExchangeID or DelegReturn operation
which requires the exclusive lock on all NFSv4 state, this can
result in a stall of the nfsd server.

This patch documents ways to avoid this problem.

This is a content change.

(cherry picked from commit 8f13abb4fd)
2024-03-31 19:16:36 -07:00
Mark Peek
14b2221ae7 efibootmgr: allow -u as a valid option
PR:		277907
Reported by:	vsasjason@gmail.com
MFC after:	1 week

(cherry picked from commit 65904399db)
2024-03-31 16:57:17 +00:00
Mark Peek
a26e93052a hyperv/hn: Don't return error when setting media to autoselect
Setting media to autoselect would always return EOPNOTSUPP.
As autoselect is the only valid media, this change now returns
success instead.

PR:		264253
Reported by:	Prakash Shiva <prakashs0234@gmail.com>
Reviewed by:	Dexuan Cui <decui microsoft com>, whu
Approved by:	whu
MFC after:	2 weeks

(cherry picked from commit 63a7c4be4a)
2024-03-31 16:49:01 +00:00
Zhenlei Huang
f3b21c5536 acpi_hpet: Make use of enum for vm_guest to improve readability
No functional change intended.

MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44402

(cherry picked from commit 579cb41b13)
(cherry picked from commit ddd779a062)
2024-03-31 23:55:49 +08:00
Rick Macklem
322412b83b vfs_vnops.c: Use va_bytes >= va_size hint to avoid SEEK_DATA/SEEKHOLE
vn_generic_copy_file_range() tries to maintain holes
in file ranges being copied, using SEEK_DATA/SEEK_HOLE
where possible.

Unfortunately SEEK_DATA/SEEK_HOLE operations can take
a long time under certain circumstances.
Although it is not currently possible to know if a file has
unallocated data regions, the case where va_bytes >= va_size
is a strong hint that there are no unallocated data regions.
This hint does not work well for file systems doing compression,
but since it is only a hint, it is still useful.

For the case of va_bytes >= va_size, avoid doing SEEK_DATA/SEEK_HOLE.

(cherry picked from commit 89f1dcb3eb)
2024-03-30 13:56:17 -07:00
Konstantin Belousov
f13afa7f54 cdevpriv(9): document devfs_foreach_cdevpriv()
(cherry picked from commit 88f2c58d1a)
2024-03-30 10:32:23 +02:00
Konstantin Belousov
8d9ed1dd50 cdevpriv(9): add iterator
(cherry picked from commit d3efbe0132)
2024-03-30 10:32:23 +02:00
Rick Macklem
d3db309653 nfsd: Add a sysctl to limit NFSv4.2 Copy RPC size
NFSv4.2 supports a Copy operation, which avoids file data being
read to the client and then written back to the server, if both
input and output files are on the same NFSv4.2 mount for
copy_file_range(2).

Unfortunately, this Copy operation can take a long time under
certain circumstances.  If this occurs concurrently with a RPC
that requires an exclusive lock on the nfsd such as ExchangeID
done for a new mount, the result can be an nfsd "stall" until
the Copy completes.

This patch adds a sysctl that can be set to limit the size of
a Copy operation or, if set to 0, disable Copy operations.

The use of this sysctl and other ways to avoid Copy operations
taking too long will be documented in the nfsd.4 man page by
a separate commit.

(cherry picked from commit 748f56c53f)
2024-03-29 18:05:31 -07:00
Stefan Eßer
f61d786c29 rtld-elf: support either byte-order of hints file
Accept either little-endian or big-endian representation of the ELF
hints magic number in the header of a hints file and convert the
parameters to the native byte-order of the repsective system.

This is a pre-requisite for a planned change to always write the byte
order in little-endian format on all architectures. The only relvant
architecture that uses big-endian data is powerpc64, and it is not
likely that new architectures will choose that representation of data
in memory.

When all supported architectures use little-endian data in the hints
file, the byte swap logic can be enabled for big-endian CPUs at
compile time. Up to that point, there is a very small run-time penalty
that is paid on all systems to check the byte-order of the hints file
and to provide the option to byte-swap the parameters read from the
hints file header.

This commit contains the changes from review D44080 (which had been
split off from this patch for easier review),

Reviewed by:	kib
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D44053

(cherry picked from commit 7b77d37a56)

rtld-elf: add some debug print statements

The byte-order independent code has been reported to fail on powerpc64.
Add some more debug statements to help identify the parametrs used and
to verify the correct operation of the byte-swap macros used..

(cherry picked from commit 173953182a)

rtld: fix check for endianess of elf hints file

Don't check if the elf hints file is in host byte order, but check
if it is in little endian by looking at the magic number.
This fixes rtld on big endian platforms.

Reviewed by:	se, kib (prior version of the patch)
Fixes:		7b77d37a56 ("rtld-elf: support either byte-order of hints")
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D44472

(cherry picked from commit da2d6e2815)

rtld: reduce debug messages after fix on big-endian hosts

Remove a debug message that had been added to support the debugging
of a mis-detection of the hint files endianness on powerpc64.

MFC after:	3 days

(cherry picked from commit c44bf7d2e9)
2024-03-29 07:43:52 +01:00
John F. Carr
b5e7969b23 Translate linux_newlstat name argument
PR:	277847

(cherry picked from commit 55e2187a09)
2024-03-27 10:27:53 +02:00
Konstantin Belousov
1d2a587ef9 daemon(8): handle case of waitpid() returning without exited child
PR:	277764

(cherry picked from commit 8eaa6be80d)
2024-03-27 10:27:52 +02:00
Gordon Bergling
285f941478 xdr(3): Fix a few typos in source code comments
- s/reoutines/routines/
- s/paraemters/parameters/

Obtained from:	NetBSD

(cherry picked from commit 577a721d05)
2024-03-26 06:56:48 +01:00
Gordon Bergling
b65d1eb9ff intr_event.9: Remove double word
- s/of of/of/

(cherry picked from commit 2c3466172a)
2024-03-26 06:56:35 +01:00
Gordon Bergling
23b4822106 cxgbe.4: Remove double word
- s/of of/of/

(cherry picked from commit 619e6f1f92)
2024-03-26 06:56:21 +01:00
Ed Maste
b16cb28aca ssh: Update to OpenSSH 9.7p1
This release contains mostly bugfixes.

It also makes support for the DSA signature algorithm a compile-time
option, with plans to disable it upstream later this year and remove
support entirely in 2025.

Full release notes at https://www.openssh.com/txt/release-9.7

Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit a91a246563)
(cherry picked from commit 464fa66f63)
2024-03-25 18:39:14 -04:00
Gordon Bergling
3b5a0cbf6a tcp_rack.4: Update the SEE ALSO section
Correct the surname of one of authors of RFC 8985 and add RFC 5681 and
RFC 6937 (PRR: Proportional Rate Reduction for TCP).

Reviewed by:	tuexen
Differential Revision:	https://reviews.freebsd.org/D44399

(cherry picked from commit e29be07861)
2024-03-25 15:58:49 +01:00
Konstantin Belousov
ed995c67e0 wmemchr(3): fix prototypes for wcpcpy() and wcpncpy()
PR:	277855

(cherry picked from commit 69d5783ae8)
2024-03-24 07:13:20 +02:00
Cy Schubert
e59ac68e25 unbound: Vendor import 1.19.3
Release notes at
	https://www.nlnetlabs.nl/news/2024/Mar/14/unbound-1.19.3-released/

Merge commit '5a33598e88ad8fbc0affa74dee0a2d8cc4010fbc' into main

(cherry picked from commit b7c0c8c18e)
2024-03-23 19:22:47 -07:00
Dimitry Andric
5c588a23c9 Slightly reorganize libclang_rt Makefile again
Make a separate .elif section for MACHINE_ARCH==powerpc, and subdivide
the MACHINE_CPUARCH values under it. If at some point more sanitizer
libraries become available for powerpc CPU architectures, they can be
added before the "nothing for other powerpc yet" case. Similar for the
MACHINE_ARCH==arm case.

PR:		262706
Fixes:		e77a1bb275
MFC after:	3 days

(cherry picked from commit 897a485c34)
2024-03-24 01:37:29 +01:00
Dimitry Andric
72d9e1e0ca Fix building of several libclang_rt libraries for powerpc64 and powerp64le
I reorganized the libclang_rt Makefile in e77a1bb275 to make it more
readable and maintainable, but the check for 32-bit powerpc was wrong.
This caused almost no libclang_rt libraries to be built for powerpc64
and powerpc64le.

PR:		262706
Reported by:	tuexen
Fixes:		e77a1bb275
MFC after:	3 days

(cherry picked from commit f0620ceecc)
2024-03-24 01:37:23 +01:00
Dimitry Andric
07839ae99c Merge commit bbb8a0df7367 from llvm-project (by Shafik Yaghmour):
[Clang] Fix ResolveConstructorOverload to not select a conversion function if we are going use copy elision

  ResolveConstructorOverload needs to check properly if we are going to use copy
  elision we can't use a conversion function.

  This fixes:

  https://github.com/llvm/llvm-project/issues/39319
  https://github.com/llvm/llvm-project/issues/60182
  https://github.com/llvm/llvm-project/issues/62157
  https://github.com/llvm/llvm-project/issues/64885
  https://github.com/llvm/llvm-project/issues/65568

  Differential Revision: https://reviews.llvm.org/D148474

This should fix 'Assertion failed: (isa<To>(Val) && "cast<Ty>() argument
of incompatible type!")' errors when building devel/boost-libs,
specifically libs/url/src/segments_view.cpp.

Bump __FreeBSD_version so this fix can easily be detected from
devel/boost-all/compiled.mk.

PR:		273335
(cherry picked from commit bcd401b5a3)
2024-03-23 13:02:23 +01:00
Ed Maste
0459337491 makefs: warn that ffs sectorsize other than 512 may not work
newfs always sets sectorsize to DEV_BSIZE (512) and derives some other
values based on the number of 512-byte sectors per real sector.  Similar
logic is required in makefs.  Until that happens, emit a warning that
the image may be incorrect.

PR:		276571
(cherry picked from commit 176b9e0d72)
(cherry picked from commit 8e40217819)
2024-03-22 15:03:48 -04:00
Ed Maste
a59eba2caa bsdlabel: limit to 8 partitions
bsdlabel is intended to support up to 20 partitions, but the disklabel
struct has a d_partitions array with only BSD_NPARTS_MIN (8) entries.
Previously, an attempt to operate on a bsdlabel with more than eight
partitions resulted in a buffer overflow.

As a stopgap limit bsdlabel to 8 partitions until this is fixed
properly.

PR:		276517
(cherry picked from commit 3f4f82c0d7)
(cherry picked from commit a323dd42bc)
2024-03-22 14:45:13 -04:00
Kyle Evans
806e51f81d if_wg: use proper barriers around pkt->p_state
Without appropriate load-synchronization to pair with store barriers in
wg_encrypt() and wg_decrypt(), the compiler and hardware are often
allowed to reorder these loads in wg_deliver_out() and wg_deliver_in()
such that we end up with a garbage or intermediate mbuf that we try to
pass on.  The issue is particularly prevalent with the weaker
memory models of !x86 platforms.

Switch from the big-hammer wmb() to more explicit acq/rel atomics to
both make it obvious what we're syncing up with, and to avoid somewhat
hefty fences on platforms that don't necessarily need this.

With this patch, my dual-iperf3 reproducer is dramatically more stable
than it is without on aarch64.

PR:		264115
Reviewed by:	andrew, zlei

(cherry picked from commit 3705d679a6)
2024-03-22 10:21:42 -05:00
Tom Coldrick
163286a861 LinuxKPI: Queue skbuffs at tail in __skb_queue_tail
Correct skb_queue_tail to queue the buffer at the tail of the skbuff.
The skbuff is a circular doubly-linked list, and we call with a pointer
to the head of the list.  Thus queueing before the head gives us a
queueing at the tail.

As a motivating factor, the current behaviour (queueing at the head) was
causing frequent kernel panics from my RTL8822BE wireless card, which
uses the rtw88 driver.  Interrupts can cause buffers to be added to the
rtwdev c2h_queue while the queue is being drained in rtw_c2h_work.
Queueing at the head would leave the nascent entry in the linked list
pointing to the old, now freed, memory for the buffer being processed.
When rtw_c2h_work is next called, we try reading this and so panic.

Reviewed by:	emaste, bz
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D44192

(cherry picked from commit d3befb534b)
(cherry picked from commit 95a7c6f18a)
2024-03-22 10:00:02 -04:00
Ed Maste
a2ef45a065 rights.4: Remove sentence implying that rights are a mask
Capability rights passed to cap_rights_* are (now) not simple bitmaks
and cannot be ORed together in general (although it will work for
certain subsets of rights).

Remove sentence that implied rights are masks.  We already have the
sentence "The complete list of capability rights is provided below" so
listing the rights without an introductory sentence seems fine.

PR:		277057
(cherry picked from commit 2c5ff9118c)
(cherry picked from commit 2031b368f8)
2024-03-22 09:35:44 -04:00
Ed Maste
e8d01b2efa path_test: fix cap_rights_init usage
Capability rights passed to cap_rights_* are not simple bitmaks and
cannot be ORed together in general (although it will work for certain
subsets of rights).

PR:		277057
Fixes:		e5e1d9c7b7 ("path_test: Add a test case for...")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 8d1348f55a)
(cherry picked from commit ea3910c452)
2024-03-22 09:35:44 -04:00
Ed Maste
ec44cc4e28 libcasper: fix cap_rights_init usage
Capability rights passed to cap_rights_* are not simple bitmaks and
cannot be ORed together in general (although it will work for certain
subsets of rights).

PR:		277057
Fixes:		faaf43b2a7 ("fileargs: add tests")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 3733d82c4d)
(cherry picked from commit be83aa2a01)
2024-03-22 09:35:44 -04:00
Ed Maste
8a17cc127b cat: fix cap_rights_init usage
Capability rights passed to cap_rights_* are not simple bitmaks and
cannot be ORed together in general (although it will work for certain
subsets of rights).

PR:		277057
Reported by:	asomers, markj

(cherry picked from commit 05f530f4d2)
(cherry picked from commit dbf34bbb18)
2024-03-22 09:35:44 -04:00
Mariusz Zaborski
1abd98ecf9 cat: add CAP_SEEK capability
The copy_file_range might require that.

Reviewed by:	emaste, theraven, kib, markj
Differential Revision:	https://reviews.freebsd.org/D41967

(cherry picked from commit 64c6327738)
(cherry picked from commit 5f527dbe41)
2024-03-22 09:35:43 -04:00