Commit graph

277398 commits

Author SHA1 Message Date
Martin Matuska 3a77c21a25 libarchive: merge from vendor branch
Libarchive 3.7.4 + three fixes from master

Security fixes:
 #2135 rar: Fix OOB in rar e8 filter (CVE-2024-26256)
 #2145 zip: Fix out of boundary access
 #2148 rar: Fix OOB in rar delta filter
 #2149 rar: Fix OOB in rar audio filter

Important bugfixes:
 #2131 7zip: Limit amount of properties
 #2110 bsdtar: Fix error handling around strtol() usages
 #2116 passphrase: Never allow empty passwords
 #2124 rar: Fix "File CRC Error" when extracting specific rar4 archives
 #2123 xar: Avoid infinite link loop
 #2150 xar: Fix another infinite loop and expat error handling
 #2108 zip: Update AppleDouble support for directories
 #2071 zstd: Implement core detectiongit

PR:	278662 (exp-run)

(cherry picked from commit 13d826ff94)
2024-05-04 13:54:42 +02:00
Martin Matuska 43a6a8b077 libarchive: add two missing package files to libarchive tests
(cherry picked from commit 7d03ec3306)
2024-05-04 13:53:07 +02:00
Martin Matuska 4217cc09bd libarchive: fix null format string error in tests (unbreaks gcc13 build)
Obtained from:	libarchive (d43c39247)

(cherry picked from commit 701d0666c0)
2024-05-04 13:53:07 +02:00
Martin Matuska aa2aad0492 libarchive: merge from vendor branch
Libarchive 3.7.3

New features:
  #1941 uudecode filter: support file name and file mode in raw mode
  #1943 7-zip reader: translate Windows permissions into UNIX
        permissions
  #1962 zstd filter now supports the "long" write option
  #2012 add trailing letter b to bsdtar(1) substitute pattern
  #2031 PCRE2 support
  #2054 add support for long options "--group" and "--owner" to tar(1)

Security fixes:
  #2101 Fix possible vulnerability in tar error reporting introduced
        in f27c173

Important bugfixes:
  #1974 ISO9660: preserve the natural order of links
  #2105 rar5: fix infinite loop if during rar5 decompression the last
        block produced no data
  #2027 xz filter: fix incorrect eof at the end of an lzip member
  #2043 zip: fix end-of-data marker processing when decompressing zip
        archives

(cherry picked from commit b9128a37fa)
2024-05-04 13:53:07 +02:00
Martin Matuska 2772835855 unzip: swtich to bsdunzip from libarchive
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)

(cherry picked from commit b5a3a89c50)
2024-05-04 13:53:07 +02:00
Martin Matuska db2cc817fa libarchive: merge from vendor branch
Changes to not yet connected unzip only.

(cherry picked from commit 058ab969fd)
2024-05-04 13:53:07 +02:00
Martin Matuska 0db84579ce libarchive: merge from vendor branch
Changes to not yet connected unzip only.

(cherry picked from commit d91bfe0fb7)
2024-05-04 13:53:07 +02:00
Martin Matuska 2cb0ab6bc1 libarchive: merge from vendor branch
Libarchive 3.7.1

Important changes (relevant to FreeBSD):
  ISSUE #1934: stack buffer overflow in cpio verbose mode
  ISSUE #1935: SEGV in cpio verbose mode
  PR #1731 tar: respect --strip-components and -s patterns in cru modes

(cherry picked from commit 64884e0d4c)
2024-05-04 13:53:07 +02:00
Martin Matuska cd09ca5e71 libarchive: merge from vendor branch
Libarchive 3.7.0

Important changes (relevant to FreeBSD):
  #1814 Do not account for NULL terminator when comparing with "TRAILER!!!"
  #1818 Add ability to produce multi-frame zstd archives
  #1840 year 2038 fix for pax archives on platforms with 64-bit time_t
  #1860 Make single bit bitfields unsigned to avoid clang 16 warning
  #1869 Fix FreeBSD builds with WARNS=6
  #1873 bsdunzip ported to libarchive from FreeBSD
  #1894 read support for zstd compression in 7zip archives
  #1918 ARM64 filter support in 7zip archives

(cherry picked from commit e64fe029e9)
2024-05-04 13:53:07 +02:00
Pierre Pronchery d2291dbb3c libarchive: Avoid a build failure with OpenSSL 3.0
This is a minimal workaround; a proper fix will come via a future update
from upstream.

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit e23d45187b)
2024-05-04 13:53:07 +02:00
Pierre Pronchery 9377240725 libarchive: Request the OpenSSL 1.1 API
OPENSSL_API_COMPAT can be used to specify the OpenSSL API version in
use for the purpose of hiding deprecated interfaces and enabling
the appropriate deprecation notices.

This change is a NFC while we're still using OpenSSL 1.1.1 but will
avoid deprecation warnings upon the switch to OpenSSL 3.0.

A future update should migrate to use the OpenSSL 3.0 APIs.

PR:		271615
Reviewed by:	emaste
Event:		Kitchener-Waterloo Hackathon 202305
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 5a7500dab9)
2024-05-04 13:53:07 +02:00
John Baldwin ffd190f223 libarchive: Remove MIPS build glue.
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D39329

(cherry picked from commit f40b617e15)
2024-05-04 13:53:07 +02:00
Konstantin Belousov d9ec850bde rtld snprintf: do not erronously skip a char at the buffer boundary
(cherry picked from commit 56ee5fc43c)
2024-05-03 03:26:26 +03:00
Konstantin Belousov cf2750be9e kcmp_pget(): do not accept TIDs
(cherry picked from commit 5b3e5c6ce3)
2024-05-03 03:26:26 +03:00
Konstantin Belousov 6b667b46ab kcmp_pget(): add an assert that we did not hold the current process
(cherry picked from commit 1e01650a78)
2024-05-03 03:26:25 +03:00
Jessica Clarke 91e0b44c15 kldxref: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15
macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after:	1 week

(cherry picked from commit 75464941dc)
2024-05-02 21:11:52 +01:00
Jessica Clarke 89342dba7d jevents: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15
macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after:	1 week

(cherry picked from commit d8c84215d7)
2024-05-02 21:11:52 +01:00
Jessica Clarke 2714c4d328 mandoc: Fix bootstrapping on macOS with Clang 16 / Apple Clang 15
macOS, like Linux, does not include an outer const qualifier for its
fts_open callback arguments, so -Wincompatible-function-pointer-types
also picks this up and breaks the build now Clang 16 makes it an error
by default. Extend the existing Linux support to fix this.

MFC after:	1 week

(cherry picked from commit ce312ef72d)
2024-05-02 21:11:52 +01:00
Alex Richardson f16e205c6f jevents: fix bootstrapping on Linux with Clang 16
The glibc fts_open() callback type does not have the second const
qualifier and it appears that Clang 16 errors by default for mismatched
function pointer types. Add an ifdef to handle this case.

Reviewed By:	imp, emaste
Differential Revision: https://reviews.freebsd.org/D43000

(cherry picked from commit 60e845ceef)
2024-05-02 21:11:52 +01:00
Alex Richardson dbbbe6f393 mandoc: fix bootstrapping on Linux with Clang 16
It appears that Clang 16 errors by default for the mismatched function
pointer types that are triggered by the fts callback (since glibc has a
callback type without the second const qualifier).
Fortunately, there is already code to handle glibc inside mandoc, we
just have to edit the checked-in config.h.

Reviewed By:	imp, emaste
Differential Revision: https://reviews.freebsd.org/D42999

(cherry picked from commit 0156465c6d)
2024-05-02 21:11:52 +01:00
Dag-Erling Smørgrav 3f59eb3141 libulog: Make sure ut_line, ut_user, ut_host are terminated.
MFC after:	3 days
Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D45004

(cherry picked from commit c28253ecde)
2024-05-02 11:08:36 +02:00
Rick Macklem f8575d4e47 krpc: Ref cnt the client structures for TLS upcalls
A crash occurred during testing, where the client structures had
already been free'd when the upcall thread tried to lock them.

This patch acquires a reference count on both of the structures
and these are released when the upcall is done, so that the
structures cannot be free'd prematurely.  This happened because
the testing is done over a very slow vpn.

Found during a IETF bakeathon testing event this week.

(cherry picked from commit 4ba444de70)
2024-05-01 18:19:09 -07:00
Rick Macklem 825cb4c850 nfscl: Clear out a lot of cruft related to B_DIRECT
There is only one place in the unpatched sources where B_DIRECT is
set in the NFS client and this code is never executed. As such, this patch
removes this code that is never executed, since B_DIRECT should never
be set.

During a IETF testing event this week, I saw a crash in ncl_doio_directwrite(),
but this function is only called if B_DIRECT is set.
I cannot explain how ncl_doio_directwrite() got called, but once this patch
was applied to the sources, the crash did not recur. This is not surprising,
since this patch deleted the function.

(cherry picked from commit 03a39a1708)
2024-04-30 18:20:50 -07:00
Rick Macklem 19b6aa047e nfscl: Do not use nfso_own for delayed nfsrpc_doclose()
When an initial attempt to close an NFSv4 lock returns NFSERR_DELAY,
the open structure is put on a list for delayed closing.  When this
is done, the nfso_own field is set to NULL, so it cannot be used by
nfsrpc_doclose().

Without this patch, the NFSv4 client can crash when a NFSv4 server
replies NFSERR_DELAY to a Close operation.  Fortunately, most extant
NFSv4 servers do not do this.  This patch avoids the crash for any
that do return NFSERR_DELAY for Close.

Found during a IETF bakeathon testing event this week.

(cherry picked from commit 6251027c42)
2024-04-30 18:16:33 -07:00
Konstantin Belousov 509819691c libc_private.h: use private namespace name for size_t
This is direct commit to stable/13.

(cherry picked from commit a951992d1e)
2024-04-30 04:15:47 +03:00
Konstantin Belousov f0e8600d71 libc printf_render_errno(): do not use strerror()
(cherry picked from commit aa66995b4c)
2024-04-30 03:49:53 +03:00
Konstantin Belousov fcac864ee1 libc: minor style, wrap long lines
(cherry picked from commit bac9d7e8f2)
2024-04-30 03:49:53 +03:00
Konstantin Belousov 27e54c9f16 __vprintf(): switch from strerror() to strerror_rl()
PR:	278556

(cherry picked from commit f887667694)
2024-04-30 03:49:53 +03:00
Konstantin Belousov a8ae94b9e2 libc: make strerror_rl() usable for libc
(cherry picked from commit 92771bc00a)
2024-04-30 03:49:52 +03:00
Mark Johnston 6f028e9108 ng_hci: Add sockaddr validation to sendto()
ng_btsocket_hci_raw_send() wasn't verifying that the destination address
specified by sendto() is large enough to fill a struct sockaddr_hci.
Thus, when copying the socket address into an mbuf,
ng_btsocket_hci_raw_send() may read past the end of the input sockaddr
while copying.

In practice this is effectively harmless since
ng_btsocket_hci_raw_output() only uses the address to identify a
netgraph node.

Reported by:	Oliver Sieber <oliver@secfault-security.com>
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 7f7b4926a7)
2024-04-29 10:05:34 -04:00
Cy Schubert e750111ced kdc: Add restart option
Add a new kdc_restart rc variable that manages kdc (or krb5kdc) under
daemon(8). This automatically restarts the kdc should it fail, i.e.
when it's configured to use LDAP as a backend and cannot connect to its
LDAP directory.

Set kdc_restart="YES" to auto restart kdc on abnormal termination.

Set kdc_restart_delay="N" to the number of seconds to delay before
restarting the kdc. The daemon(8) default seconds applies when not set.

Reported by:		Lexi Winter <lexi.freebsd@le-fay.org>
PR:			278395
Differential Revision:	https://reviews.freebsd.org/D44898

(cherry picked from commit 9e248b7f64)
2024-04-29 05:51:11 -07:00
Cy Schubert a161f2405f heimdal: Fix compiling hdb ldap as a module
Fix build when WITH_OPENLDAP defined.

PR:		278430
Obtained from:	Upstream c1c7da7f79

(cherry picked from commit a0d7d68a2d)
2024-04-29 05:51:11 -07:00
Dag-Erling Smørgrav b7a56907af adduser: Overhaul.
Most importantly:

* Make local variables local.
* Use `$()` instead of backticks.
* Avoid unsafe use of `-a` and `-o` operators in `test` expressions.
* Remove a hack intended to ease the transition from Perl 22 years ago.

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

(cherry picked from commit 170d088290)

adduser: A few more improvements.

MFC after:	1 week
Reviewed by:	jrm
Differential Revision:	https://reviews.freebsd.org/D44871

(cherry picked from commit b37333899b)

adduser: Fix a syntax error

Reported by:	Jose Luis Duran <jlduran@gmail.com>
Fixes:		b37333899b
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D44871

(cherry picked from commit 5cafc38f11)

adduser: Really fix a syntax error

Fixes:		5cafc38f11
Differential Revision:	https://reviews.freebsd.org/D44871

(cherry picked from commit 9e8618276f)
2024-04-29 12:30:39 +02:00
John Grafton 72fc3645e0 adduser(8): support creation of ZFS dataset
On systems utilizing ZFS, default to creating a ZFS dataset for a new
user's home directory if the parent directory resides on a ZFS dataset.
Add a flag that disables this behavior if the administrator explicitly
does not want it.

If run during installation from within a chroot, set mountpoint to legacy
after dataset creation and mount directly into the chroot.  Then umount
and reset the mountpoint to inherit from parent.

Also support ZFS default encryption on user's home directory.

Feedback by: delphij
Reviewed by: imp, kevans
Pull Request: https://github.com/freebsd/freebsd-src/pull/881

(cherry picked from commit 215c0a5158)
2024-04-29 12:16:06 +02:00
Sven Ruediger 1da8405cde add defaults for adduser.sh (OK? [yes] & additional user [no])
Event:		Kitchener-Waterloo Hackathon 202305
Differential Revision:	https://reviews.freebsd.org/D40157

(cherry picked from commit 9efad6f9e1)
2024-04-29 12:16:06 +02:00
Olivier Certner eb07a26af1
sys_procctl(): Make it clear that negative commands are invalid
An initial reading of the preamble of sys_procctl() gives the impression
that no test prevents a malicious user from passing a negative commands
index (in 'uap->com'), which is soon used as an index into the static
array procctl_cmds_info[].

However, a closer examination leads to the conclusion that the existing
code is technically correct.  Indeed, the comparison of 'uap->com' to
the nitems() expression, which expands to a ratio of sizeof(), leads to
a conversion of 'uap->com' to an 'unsigned int' as per Usual Arithmetic
Conversions/Integer Promotions applied by '<=', because sizeof() returns
'size_t' values, and we define 'size_t' as an equivalent of 'unsigned
int' (which is not mandated by the standard, the latter allowing, e.g.,
integers of lower ranks).

With this conversion, negative values of 'uap->com' are automatically
ruled-out since they are converted to very big unsigned integers which
are caught by the test.  An analysis of assembly code produced by LLVM
16 on amd64 and practical tests confirm that no exploitation is possible.

However, the guard code as written is misleading to readers and might
trip up static analysis tools.  Make sure that negative values are
explicitly excluded so that it is immediately clear that EINVAL will be
returned in this case.

Build tested with clang 16 and GCC 12.

Approved by:    markj (mentor)
MFC after:      1 week
Sponsored by:   The FreeBSD Foundation

(cherry picked from commit afc10f8bba)

Approved by:    emaste (mentor)
2024-04-29 14:33:30 +09:00
Kyle Evans f224a2ca04 script: handle terminal resize on SIGWINCH
Add a -w flag to forward terminal resize events on to the child, which
can be useful in some circumstances to avoid terminal corruption.

Reviewed by:	des
Co-authored-by:	Xavier Beaudouin <xavier.beaudouin@klarasystems.com>
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.

(cherry picked from commit 8ceac8e13d)
2024-04-29 00:28:45 -05:00
Xavier Beaudouin 2a2cc22f51 script: minor style improvements
Fix some nits pointed out by checkstyle9.pl in advance of functional
changes to script(1).

Reviewed by:	des
Sponsored by:	Modirum MDPay
Sponsored by:	Klara, Inc.

(cherry picked from commit 4459abe334)
2024-04-29 00:28:45 -05:00
Warner Losh 6063683eb8 ada: Another NCQ Trim instability drive
The Seagate IronWolf 110 SATA SSD drive has been reported to be unstable
with NCQ trim enabled.

PR: 264139
Sponsored by:		Netflix

(cherry picked from commit a6cef61766)
2024-04-28 20:35:12 -06:00
Mateusz Piotrowski 5119386711 sync.8: Document that the "sync dance" is not a thing
People still believe that it is essential to run sync(8) a couple of
times before a reboot/halt. Document that this has not been necessary
for a long time now.

Reviewed by:	imp, bcr, Pau Amma <pauamma@gundo.com>
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D33233

(cherry picked from commit 177ba18307)
2024-04-28 20:29:36 +02:00
Dimitry Andric b9b248b1df Merge commit 0f329e0246d1 from llvm-project (by Dimitry Andric):
[sanitizer_symbolizer] Cast arguments for format strings in markup (#89815)

  When compiling the common sanitizer libraries, there are many warnings
  about format specifiers, similar to:

      compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup.cpp:31:32: warning: format specifies type 'void *' but the argument has type 'uptr' (aka 'unsigned long') [-Wformat]
         31 |   buffer->AppendF(kFormatData, DI->start);
            |                   ~~~~~~~~~~~  ^~~~~~~~~
      compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup_constants.h:33:46: note: format string is defined here
         33 | constexpr const char *kFormatData = "{{{data:%p}}}";
            |                                              ^~
            |                                              %lu
      compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup.cpp:46:43: warning: format specifies type 'void *' but the argument has type 'uptr' (aka 'unsigned long') [-Wformat]
         46 |   buffer->AppendF(kFormatFrame, frame_no, address);
            |                   ~~~~~~~~~~~~            ^~~~~~~
      compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_markup_constants.h:36:48: note: format string is defined here
         36 | constexpr const char *kFormatFrame = "{{{bt:%u:%p}}}";
            |                                                ^~
            |                                                %lu
      ...

  This is because `uptr` is dependent on the platform, and can be either
  `unsigned long long`, `unsigned long`, or `unsigned int`.

  To fix the warnings, cast the arguments to the expected type of the
  format strings.

PR:		276104
Reported by:	pstef
MFC after:	3 days

(cherry picked from commit f08bf5a3ac)
2024-04-28 10:04:33 +02:00
Gordon Bergling 3ad3a5f32b vmm(4): Fix a typo in a kernel message
- s/cant/can't/

(cherry picked from commit 8b5c5cae92)
2024-04-28 07:21:41 +02:00
Gordon Bergling 5f9d770bdc wtap: Fix typos in kernel messages
- s/cant/can't/

(cherry picked from commit 026520a5f2)
2024-04-28 07:21:33 +02:00
Rick Macklem fba90651e4 Revert "nfsd: Fix NFSv4.1/4.2 Claim_Deleg_Cur_FH"
This reverts commit f300335d9a.

It turns out that the old code was correct and it was wireshark
that was broken and indicated that the RPC's XDR was bogus.
Found during IETF bakeathon testing this week.

(cherry picked from commit 54c3aa02e9)
2024-04-27 18:41:12 -07:00
Dag-Erling Smørgrav 1799750704 cp: Clarify an obscure comment.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D44805

(cherry picked from commit 64d6925d19)

cp: Additional sanity check.

Once we've successfully opened the file we've been asked to copy, check
that it's of the same type as FTS told us it was.

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

(cherry picked from commit 9075d4cfad)

cp: Use warnc().

MFC after:	1 week
Sponsored by:	Klara, Inc.

(cherry picked from commit f070188c3a)
2024-04-27 14:58:40 +00:00
Dag-Erling Smørgrav 44101eb580 install: Always use a temporary file.
Previously, we would only use a temporary file if explicitly asked to
with the `-S` option, and even then, only if the target file already
existed.  This meant that an outside observer looking for the target
file might see a partial file, and might see the file disappear and
then reappear.

With this patch, we always use a temporary file, ensuring atomicity.
The downside is slightly increased disk usage.  The upside is never
having to worry about, for instance, cron jobs randomly failing if
they happen to run simultaneously with `make installworld`.

The `-S` option is retained, partly for compatibility, and partly
to control the use of `fsync(2)`, which has a non-negligible cost
(approximately 10% increase in wall time for `make installworld`).

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	0mp, brooks, imp, markj
Differential Revision:	https://reviews.freebsd.org/D44742

(cherry picked from commit e5035d0857)

install: Simplify path construction.

There's no need to copy the path twice to split it into base and dir.
We simply call `basename()` first, then handle the two trivial cases in
which it isn't safe to call `dirname()`.

While here, add an early check that the destination is not an empty
string.  This would always fail eventually, so it may as well fail
right away.  Also add a test case for this shortcut.

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

(cherry picked from commit 17dc7017d7)

install: Remove the mmap(2) option.

We already removed it from cp(1) over a year ago but never followed up
here.  Do so now, for the same reasons: significant complexity for
little to no benefit.

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

(cherry picked from commit a0439a1b82)

install: Assorted nitpickery.

* Use `errc()` instead of manually setting `errno` before calling `err()`.
* Change one warning into a fatal error.
* Drop some unnecessary casts.
* `strlcat()` bounds checks were off-by-one.  This does not matter in
  practice because the subsequent code renders an overrun harmless.
* We were passing `SSIZE_MAX` to `copy_file_range()` instead of the
  requested size.  This only matters if we're asked to install a file
  which is still being written to while we are copying it.

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

(cherry picked from commit 000a533e6d)
2024-04-27 14:58:40 +00:00
Dag-Erling Smørgrav 82c8a5f4f1 nullfs: Show correct exported flag.
MFC after:	3 days
Reviewed by:	allanjude, kib
Differential Revision:	https://reviews.freebsd.org/D44773

(cherry picked from commit 2b258dd17c)
2024-04-27 14:58:40 +00:00
Doug Rabson 1d06b45463 Fix MNT_IGNORE for devfs, fdescfs and nullfs
The MNT_IGNORE flag can be used to mark certain filesystem mounts so
that utilities such as df(1) and mount(8) can filter out those mounts by
default. This can be used, for instance, to reduce the noise from
running container workloads inside jails which often have at least three
and sometimes as many as ten mounts per container.

The flag is supplied by the nmount(2) system call and is recorded so
that it can be reported by statfs(2). Unfortunately several filesystems
override the default behaviour and mask out the flag, defeating its
purpose. This change preserves the MNT_IGNORE flag for those filesystems
so that it can be reported correctly.

MFC after:	1 week

(cherry picked from commit b5c4616582)
2024-04-27 14:58:39 +00:00
Denny Page 90499f6efd Support ARP for 802 networks
This is used by 802.3 Ethernet.  (Also be used by 802.4 Token Bus and
802.5 Token Ring, but we don't support those.)

This was accidentally removed along with FDDI support in commit
0437c8e3b1, presumably because comments implied it was used only by
FDDI or Token Ring.

Fixes: 0437c8e3b1 ("Remove support for FDDI networks.")
Reviewed-by: emaste
Signed-off-by: Denny Page <dennypage@me.com>
Pull-request: https://github.com/freebsd/freebsd-src/pull/1166
(cherry picked from commit fcdf9a1989)
(cherry picked from commit d776dd5fbd)
2024-04-27 10:47:16 -04:00
Ricardo Branco 302d0acea8 MFV: less: Do not trust st_size if it equals zero
This is a smaller version of upstream
1fafd968b48e5cea6c85f126d77071a8de707a55 to address the
issue that less not being able to operate on files
residing in pseudo-filesystems that advertize a zero
size value.

PR:		bin/276133

(cherry picked from commit cae336280b)
2024-04-27 00:08:17 -07:00