Commit graph

15728 commits

Author SHA1 Message Date
Eugene Grosbein
22f11923c6 mkimg.1: add new PARTITION SPECIFICATION section
The specification follows a commentary to the function parse_part()
in the source code and the code itself.

(cherry picked from commit d1797fb5bbaeb212501a72b916d647fb2e021d50)
2024-03-01 21:47:33 +07:00
Rick Parrish
e38dee6120 posixmqcontrol(1): manage posix message queues
(cherry picked from commit 0112f8c4a88e75342bdb6b9815fa220c5f645aa0)
2024-03-01 06:12:02 +02:00
Dag-Erling Smørgrav
181e968377 sdiff: Misc cleanup.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43943

(cherry picked from commit 3cc86989bfbe27c91b5db592c2af33fef153e230)

sdiff: Fix --expand-tabs and --tabsize.

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

(cherry picked from commit a834edfccd14a8c0f152a3b0078469af8e05f3fd)

sdiff: Fix binary case.

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

(cherry picked from commit ad7bef8b890768e68a48bbfa6b92ebf635068504)
2024-02-24 13:12:49 +01:00
Dag-Erling Smørgrav
4ffc5ab03f patch: Support long context lines.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D43850

(cherry picked from commit 851a9da38f070675c42a6d69c41c47a5d29ee3d0)
2024-02-24 13:12:49 +01:00
Dag-Erling Smørgrav
fa778f0ce5 bintrans: Error out if writing to the output failed.
- Cover all code paths.
- When decoding, check all output files, not just the last one.
- A simple `ferror()` check is not enough as an error may later occur
  while flushing whatever remains in the output buffer.

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

(cherry picked from commit 5cb28f7979773715615cc2131fe40e0c5879ed1d)

bintrans: Fix uninitialized variable.

`prev` may be used uninitialized if `body` starts with a newline.

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

(cherry picked from commit bce34cba07bcfed9cd519a658e594c9910c8f210)

bintrans: Add base64 to name list in manual page.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	0mp, pstef
Differential Revision:	https://reviews.freebsd.org/D43558

(cherry picked from commit 64028ac3ba9668cff31bfe2c79d85a3b89e10953)

bintrans: Remove unused variable.

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

(cherry picked from commit bc2913d1736c2b299a265741a779014d001bd108)
2024-02-24 13:12:49 +01:00
Dimitry Andric
5fe7f76dd6 Remove usr.bin/clang/llvm-ar/llvm-cxxfilt-driver.cpp file
I accidentally copied this to the wrong place, or by accident to two
places, during the merge of llvmorg-17-init-19304-gd0b54bb50e51.

Fixes:		06c3fb2749bd
MFC after:	3 days

(cherry picked from commit 4015c064200e643ab110cdf831064c3c73f31b73)
2024-02-13 18:51:33 +01:00
Wolfram Schneider
47cb760dac man: support special characters in filenames
man.sh needs to handle double quotes and sub shell character
as '`' '$' etc.

PR:		275967
Reviewed by:	bapt

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

(cherry picked from commit b8a484ec343d163a40f7cf4a6026e880f992c738)
2024-01-31 14:47:33 +00:00
Tijl Coosemans
aaefd6898a join(1): Fix ordering in case of missing fields
The comparison function had the ordering reversed causing join(1) to
miss some matching lines.

PR:		232405
Submitted by:	Martijn van Duren <martijn@openbsd.org>

(cherry picked from commit 95bf75895ddcf17402b1f69dce26cb821c922476)
2024-01-31 09:53:11 +01:00
Mark Johnston
1c090bf880 top: Avoid printing a blank line when the ZFS ARC is empty
PR:		275994
MFC after:	2 weeks

(cherry picked from commit 1f62718d8ba26d813d8c2e826ac5f4caee4c6730)
2024-01-25 09:57:12 -05:00
Dag-Erling Smørgrav
559c7ac87d renice: Clean up the tests a bit.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	ngie, asomers
Differential Revision:	https://reviews.freebsd.org/D43087

(cherry picked from commit afdce0837014fb7a41fced959c9457f89e878052)
2024-01-21 17:08:48 +01:00
Wolfram Schneider
7169c947ab man(1): support spaces in filenames
The globbing function in exists() needs to handle white spaces.

PR:          275978
Reviewed by: kevans, bapt, emaste
Differential Revision: https://reviews.freebsd.org/D43222
MFC after:   1 week

(cherry picked from commit e3c7b76fa8105929ae9a785e5ffc44274b1b0a81)
2024-01-20 08:51:12 +00:00
Lexi Winter
d741d23133 nfsstat: make -q work without -e/-E
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/961

(cherry picked from commit f79b200b6aefb9bdcbe931c5b7ea604e259beee0)
2024-01-19 18:55:26 -07:00
Lexi Winter
be908114fd nfsstat: update option strings in docs
Add the missing -q option to the nfsstat(1) manpage SYNOPSIS (it is
already documented in DESCRIPTION), and add the missing -E and -q
options to the built-in usage output.

PR:		275912
Pull Request:	https://github.com/freebsd/freebsd-src/pull/958

(cherry picked from commit 30ce26cacfd626552c647c9327dd510e7f421d97)
2024-01-19 18:54:27 -07:00
Lexi Winter
f2ad8d3a13 mail: add volatile in grabh()
setjmp() requires that any stack variables modified between the setjmp
call and the longjmp() must be volatile.  This means that 'saveint' in
grabh() must be volatile, since it's modified after the setjmp().
Otherwise, the signal handler is not properly restored, resulting in a
crash (SIGBUS) if ^C is typed twice while composing.

PR:		276119
Reported by:	Christopher Davidson <christopher.davidson@gmail.com>
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/993

(cherry picked from commit 6c951b37170f1fb2ae8b4827070743e61b6eaed2)
2024-01-19 09:25:05 -05:00
Dag-Erling Smørgrav
cef433d3fb uniq: Replace NetBSD's unit tests with our own.
These new tests cover more functionality and are easier to extend.

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

(cherry picked from commit e762fd81e253d4ae9b9f7d2e65cf448633bbe527)

uniq: Fix interactive use.

Output a line as soon as it is possible to determine that it will have
to be output.  For the basic case, this means output each line as it is
read unless it is identical to the previous one.  For the -d case, it
means output the first instance as soon as the second is read, unless
the -c option was also given.  The -D and -u cases were already fine.

Add test cases for interactive use with no options and with -d.

Explicitly ignore -d when -D is also specified.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	rew, kevans
Differential Revision:	https://reviews.freebsd.org/D43382

(cherry picked from commit 11715600e626cf6cc4b4f564af97f6ae1e5fb0be)

uniq: Clean up and test obsolete options.

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

(cherry picked from commit e2ec8ee02a33e39b8ff86a56e8a1ef5e84ac7e62)

uniq: Error out if writing to the output failed.

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

(cherry picked from commit 899837e8f5741f9a847b63d9e7c8b76ccc033ab5)
2024-01-17 19:28:23 +01:00
Dag-Erling Smørgrav
e3057ee0bf login: Use getpwnam_r() instead of getpwnam().
Since we expect the entry to still be valid after calling into PAM,
which may call getpwnam() itself, we need to use getpwnam_r().

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

(cherry picked from commit a3d80dd8aa6ac15877e00102ab174b417ac81d79)

login: Missed an instance of getpwnam().

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

(cherry picked from commit 1e25eb287f3fdd763df98065dbf2e1eb201e4000)
2024-01-17 19:28:22 +01:00
Dag-Erling Smørgrav
93805b27ea asa: Rewrite to fix line termination issue.
The standard is somewhat unclear, but on the balance, I believe that the
phrase “the rest of the input line” should be interpreted to mean the
rest of the input line including the terminating newline if and only if
there is one.  This means the current implementation is incorrect on two
points:

- First, it suppresses the previous line's newline in the '1' case.

- Second, it unconditionally emits a newline at the end of the output
  for non-empty input, even if the input did not end with a newline.

Resolve this by rewriting the main loop.  Instead of special-casing the
first line and then assuming that every line ends with a newline, we
remember how each line ends and emit that either at the beginning of
the next line or at the end of the file except in the one case ('+')
where the standard explicitly says not to.

While here, try to reduce diff to upstream a little and update their
RCS tag to reflect the fact that while we've diverged significantly
from them, we've incorporated all their changes.  Remove the useless
second RCS tag.

We also update the tests to account for the change in interpretation
of the '1' case and add a test case for unterminated input.

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

(cherry picked from commit c2356a440db91c106867d45c94b3d6d7bc0e50f0)
2024-01-17 19:28:22 +01:00
Dag-Erling Smørgrav
2ba859e199 find: Add a warning about -delete.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	pauamma_gundo.com
Differential Revision:	https://reviews.freebsd.org/D43162

(cherry picked from commit 45438f9c8b5b91ebf5606b4a98e891559913d25b)
2024-01-17 19:28:22 +01:00
Wolfram Schneider
1540a1b6fc fix using man(1) with multiple pages
PR: 275978
Reported by: Mohamed Akram
Fixes: 789480702e490818244af11279868ba4f3dabe6b
MFC after: 1 week

(cherry picked from commit 1e82d882ed3372bcaf82451bfb865483a409ab1f)
2024-01-15 07:34:27 +00:00
Jose Luis Duran
38fe4bc082 dtc: Sync with upstream commit 26a0fe5
- 0206c0f ("Handle top-level /delete-node/ directives.")
- d612a9e ("Remove C++11 standard constrain")
- Remove extra white lines after the $FreeBSD$ tag removal

Reviewed by:	kevans (earlier), theraven, emaste
Differential Revision: https://reviews.freebsd.org/D41482

(cherry picked from commit 29a55fd09b0a3cc4c888f7a630fde41694699343)
(cherry picked from commit f147cf0ee2b2642c0a133a71c8a5dc018518d923)
2024-01-10 13:50:53 -05:00
Dimitry Andric
fe013be447 Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvm-project main llvmorg-17-init-19304-gd0b54bb50e51, the
last commit before the upstream release/17.x branch was created.

PR:		273753
MFC after:	1 month

(cherry picked from commit 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
2024-01-07 18:46:17 +01:00
Andrew Turner
2f3b605b2e llvm: Reduce overlinking with the minimal llvm
We only need to link against libz and libzstd when linking against the
fill libllvm, libllvmminimal doesn't use either library. Move adding
libz and libzstd to the list of libraries to link against to where
we decide to use the full libllvm.

Reported by:	Cristian Marussi <Cristian.Marussi@arm.com>
Reported by:	Colin S. Gordon <csgordon@fastmail.com>
Reviewed by:	dim
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D42528

(cherry picked from commit 83771b1914e182c6324839e05ff82ee6f4a87c98)
2024-01-07 18:46:15 +01:00
Gordon Bergling
ab37ee306b tail(1): Fix a typo in a source code comment
- s/recieved/received/

(cherry picked from commit c58205be7a7d4eb1c68b169bb7fdb57f1e057cc5)
2024-01-07 12:41:20 +01:00
Ed Maste
99d97cf3ae lastcomm: update amd64 and i386 tests for additional timestamp resolution
Fixes: 6f4ce7e89ba4 ("lastcomm: improve timestamp display")
Sponsored by:	The FreeBSD Foundation

(cherry picked from commit f079ef5b6a3c6d8800724286675199f79b553ccb)
(cherry picked from commit 407e2d7cf1b6762c9768eaff60500b8d007cd81c)
2024-01-06 20:27:18 -05:00
Michael Paepcke
692c0a2e80 lastcomm: improve timestamp display
Adjust the lastcomm command to output timestamps with a precision of
seconds.

Reported by:	Dr. Andreas Longwitz
Reviewed by:	emaste
Relnotes:	Yes
Sponsored by:	DSS Gmbh
Pull Request:	https://github.com/freebsd/freebsd-src/pull/802

(cherry picked from commit 6f4ce7e89ba4fa52566704533920352aa65c7f9b)
2024-01-06 20:27:18 -05:00
Wolfram Schneider
d93d7230fa support spaces in filenames
PR:		275978
MFC after:	1 week

(cherry picked from commit 789480702e490818244af11279868ba4f3dabe6b)
2024-01-05 08:21:05 +00:00
Wolfram Schneider
c3c8d1f55d improve handling of shell metacharacters in filenames
PR:		275967
MFC after:	1 week

(cherry picked from commit c4368d03e52c7c97d583ee6b81a59510d371ffbb)
2024-01-05 08:18:01 +00:00
Kyle Evans
bcfe05c6b6 calendar: correct the search order for files
Include files that don't begin with a '/' are documented to search the
current directory, then /usr/share/calendar.  This hasn't been accurate
for years, since e061f95e7b ("Rework calendar(1) parser") rewrote a
lot of this.

Stash off the cwd before we do any chdir()ing around and use that to
honor the same order we'll follow for the -f flag.  This may result in
an extra lookup that will fail for the initial calendar file, but I
don't think it's worth the complexity to avoid it.

While we're here, fix the documentation to just reference the order
described in FILES so that we only need to keep it up to date in one
place.

Reviewed by:	bapt
Sponsored by:	Klara, Inc.

(cherry picked from commit 0a82cd4f101c5eb8533a0049aaa3f06f005cf8af)
2024-01-02 22:47:22 -06:00
Kyle Evans
346112fe3d kdump: use print_mask_arg0 appropriately
Some callers are using print_mask_arg() when they should be using
print_mask_arg0(); the latter should be used when all flags are optional
and there's not a flag to be decoded with a 0-mask.  This turns:

nmount(0x6991e009000,0x8,0<><invalid>0)

into:

nmount(0x6991e009000,0x8,0)

Reviewed by:	jhb

(cherry picked from commit a206524709bdfbd577bcfe76676da80b8250f84c)
2024-01-02 22:47:21 -06:00
Christos Margiolis
ab71e34809 fortune: update mailing list search url
Markmail no longer exists.

Reviewed by:	markj
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D43209

(cherry picked from commit 2b1c477d88e579585c6b3ba5f6ded70b9a05e3c3)
2023-12-31 15:46:55 +02:00
Alexander Motin
473dc8e1ba vmstat: Rely on libxo for numbers humanization
This makes code cleaner, plus fixes such nonsense as humanized JSON
and XML, making all numbers raw without quotes, spaces, suffixes, etc.

MFC after:      2 weeks

(cherry picked from commit 1f36ca5de596f7c2eb446df5b8e06877901d727a)
2023-12-22 23:13:24 -05:00
Alexander Motin
bf5635d594 vmstat: Let libxo properly humanize -m numbers
Raw numbers can be seen in json/xml or with --libxo=no-humanize.

MFC after:	2 weeks

(cherry picked from commit 598d1ac85e87d9312b9fd3266908ab6a6768edc6)
2023-12-22 23:13:24 -05:00
Alexander Motin
b0b4dedfa1 vmstat: Improve -z formatting for large names/values
MFC after:	2 weeks

(cherry picked from commit 6f048e71304310db80a210d07cb3768de18589c8)
2023-12-22 23:13:24 -05:00
Alexander Motin
b65b88dc3a vmstat: Make disks reporting some more reasonable
MFC after:	1 month

(cherry picked from commit 7b21c447fb7b761f094c3c2ce2e6d6e2c91c285c)
2023-12-22 23:13:24 -05:00
Kyle Evans
78e30818a0 lockf: switch to strtonum() for parsing timeout
Convert waitsec to a long long to be able to hold the full domain of
alarm(3) timeout on all platforms, and let strtonum(3) handle the input
validation.  strtonum(3) also happens to provide a neater interface for
error handling, and it already includes our pre-existing empty input
check.

Sponsored by:	Klara, Inc.

(cherry picked from commit e4967d4d48b0a7d873e4f778c0a6e560e09d4dc3)
2023-12-14 18:58:33 -06:00
Kyle Evans
63b86eb6fa lockf: allow locking file descriptors
This is most useful inside a shell script, allowing one to lock just
portions of a script rather than having to wrap the entire script in a
lock.

PR:		262738
Reviewed by:	0mp, allanjude (both previous versions)
Co-authored-by:	Daniel O'Connor <darius@dons.net.au>
Sponsored by:	Klara, Inc.

(cherry picked from commit 09a7fe0a5523d53ff6c26ddef9a947f293e18c22)
2023-12-14 18:58:29 -06:00
Kyle Evans
40754cd21e lockf: add some tests
Provide basic coverage for the existing options, nothing deeper (e.g.,
pipe closing behavior) is tested in this set.

Reviewed by:	allanjude
Feedback from:	des
Sponsored by:	Klara, Inc.

(cherry picked from commit 296a5a4db1fc8203f5f6aa8f68321e6ab4652b56)
2023-12-14 18:58:25 -06:00
Alexander Melkov
579c24898b lockf: don't hold stdin/stdout/stderr open
None of these are essential in the lockf monitor (parent post-fork), so
close them to maintain the illusion that lockf hasn't been inserted into
the pipeline.  This ensures that the correct effects happen on other
programs in the pipeline if the locked command closes or redirects these
elsewhere.

The original patch used -s to close stdout/stderr rather than closing
them unconditionally, but it's not clear that we really care that much.
kevans dropped that part when taking the patch, patch is otherwise by
listed author.

PR:		112379
Reviewed by:	0mp, allanjude (both earlier version), kevans
Feedback from:	des
Sponsored by:	Klara, Inc.

(cherry picked from commit 18425c19cae08cbe41801845457ed67285806688)
2023-12-14 18:58:20 -06:00
Kyle Evans
6128f0c28d lockf: hide unavailable error with -n -s
The error message is expected, allow -s to suppress just that one since
it would loosely fall under the definition of "failure to acquire the
lock" described in the manpage for the -s option.

Reviewed by:	0mp, allanjude
Feedback from:	des
Sponsored by:	Klara, Inc.

(cherry picked from commit 3041e6950d07f0d11c9f91fefbf3c273cbbe4407)
2023-12-14 18:58:15 -06:00
Kyle Evans
8a152128dc lockf: correct omission in the usage statement
The -w flag was added without being noted in the usage statement; fix
that now.

While we're here, re-sort the getopt() string.

Reviewed by:	0mp, allanjude, des
Sponsored by:	Klara, Inc.

(cherry picked from commit 35095fd23f071d03633312b91a5b460eaf811efa)
2023-12-14 18:58:11 -06:00
Kyle Evans
cdd2624a97 localedef: expand the default charmap
POSIX defines a number of other control characters as well as
alternative aliases for some that should be provided in the default set,
so let's go ahead and add those.

Reviewed by:	bapt, yuripv
Sponsored by:	Klara, Inc.

(cherry picked from commit 3a7ffe206ce7e4741fae26432f6d6e5159207f45)
2023-12-14 18:57:59 -06:00
Warner Losh
431d8b78ed sort: Only build FreeBSD-specific ALTMON_x stuff when ATLMON_1 is defined
On MacOS, we bootstrap sort. Since ALTMON_* are not defined there, the
build blows up. Since we don't need this feature for the FreeBSD build
process, and since we won't use it unless we actually install the NL
files that have this data in it, just #ifdef it out for now. In the
extremely unlikely event that the FreeBSD bootstrap/build process grows
this dependency, we can evaluate the best solution then (which most
likely is going to be not depend on the local's month names).

Fixes:			3d44dce90a69 (MacOS builds and github CI)
Sponsored by:		Netflix
Reviewed by:		jrtc27, jlduran@gmail.com, markj
Differential Revision:	https://reviews.freebsd.org/D42868

(cherry picked from commit bd234c0d4c8256db7e5a1fdda9ef311c9e0080e4)
2023-12-15 02:42:35 +02:00
Christos Margiolis
bd1739a707 sort: test against all month formats in month-sort
The CLDR specification [1] defines three possible month formats:

- Abbreviation (e.g Jan, Ιαν)
- Full (e.g January, Ιανουαρίου)
- Standalone (e.g January, Ιανουάριος)

Many languages use different case endings depending on whether the month
is referenced as a standalone word (nominative case), or in date context
(genitive, partitive, etc.). sort(1)'s -M option currently sorts months
by testing input against only the abbrevation format, which is
essentially a substring of the full format. While this works fine for
languages like English, where there are no cases, for languages where
there is a different case ending between the abbreviation/full and
standalone formats, it is not sufficient.

For example, in Greek, "May" can take the following forms:

Abbreviation: Μαΐ (genitive case)
Full: Μαΐου (genitive case)
Standalone: Μάιος (nominative case)

If we use the standalone format in Greek, sort(1) will not able to match
"Μαΐ" to "Μάιος" and the sort will fail.

This change makes sort(1) test against all three formats. It also works
when the input contains mixed formats.

[1] https://cldr.unicode.org/translation/date-time/date-time-patterns

Reviewed by:	markj
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D42847

(cherry picked from commit 3d44dce90a6946e2ef2ab30ffbf8e2930acf888b)
2023-12-15 02:42:26 +02:00
Kenneth D. Merry
a9262d053b Add IBM TS1170 density codes and specs.
These were obtained from a drive, but they agree with the IBM
documentation.

The bpi/bpmm values are the same as TS1160, but the number of
tracks is much larger (18944 tracks vs 8704 for TS1160).  The tapes
are also longer, 1337m total.  (According to the MAM on a sample JF
tape.  I don't have a JE tape handy to compare.)  The end result
is a 50TB raw capacity (150TB compressed) for TS1170 with a JF
cartridge vs 20TB raw capacity (60TB compressed) for TS1160 with
a JE cartridge.

lib/libmt/mtlib.c:
	Add the TS1170 density codes to the denstiy table in libmt.

usr.bin/mt/mt.1:
	Add the TS1170 density codes and specs to the density table
	in the mt(1) man page.  As usual for TS drives, there is an
	encrypted and non-encrypted density code (0x79 and 0x59
	respectively).

Sponsored by:	Spectra Logic

(cherry picked from commit 83823d063ab57db8d3954c1530d036f1ccdceb41)
2023-12-14 15:55:24 -05:00
Dag-Erling Smørgrav
7441705cae tail: Fix heap overflow in -F case.
The number of events we track can vary over time, but we only allocate
enough space for the exact number of events we are tracking when we
first begin, resulting in a trivially reproducable heap overflow.  Fix
this by allocating enough space for the greatest possible number of
events (two per file) and clean up the code a bit.

Also add a test case which triggers the aforementioned heap overflow,
although we don't currently have a way to detect it.

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

(cherry picked from commit 621f45532c5887c96b708ce232c52878d0053325)

tail: Clean up error messages.

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

(cherry picked from commit b70e57be2cfe83ec9f410e2f317ea38aaac61a98)
2023-12-13 17:41:48 +01:00
Dag-Erling Smørgrav
6d0ea82cc2 libfetch, fetch: Stop recommending the use of ca_root_nss.
MFC after:	3 days
Reviewed by:	kevans, emaste
Differential Revision:	https://reviews.freebsd.org/D42119

(cherry picked from commit 2821a7498f65d357c68166e1978b491abef1ca4a)
2023-12-13 17:23:57 +01:00
Maxim Sobolev
020432848e vmstat: fix column names broken in c168508655
Loss of the trailing space in the multi-line format string has
resulted in column name being emitted as "FAILSLEEP", instead of
two columns "FAIL" and "SLEEP".

(cherry picked from commit 62d47a4db4579315d7b89002d7de696b44ae1415)
2023-12-04 17:46:57 -08:00
Baptiste Daroussin
a501d357eb genl: add a monitor subcommand
usage:
$ genl monitor <family> <multicats group>

this subcommand allows to monitor the message from a multicast group
of a given family when received.

If it knows how to parse the messages received it will dump the decoded
version, otherwise it will just inform a new message has been received

So far it only knows how to parse nlctrl notify messages, but the plan
to allow to make the parsing extensible via lua scripts

Differential Revision:	https://reviews.freebsd.org/D40372

(cherry picked from commit e19b2ef976d326d34b17331c5071d9e687d0d5d5)
2023-12-04 11:21:33 +01:00
Baptiste Daroussin
8b2cfd9d19 nvi: import version 2.2.1
(cherry picked from commit 0fcececbac9880b092aeb56a41a16f1ec8ac1ae6)
2023-12-04 11:20:00 +01:00
Mateusz Piotrowski
b46a05cfa6 tail.1: Add an example for +n 1
MFC after:	3 days
Sponsored by:	Klara, Inc.

(cherry picked from commit 9f20787fe89e2a912a9e5dd2d3da56087722e8c2)
2023-12-01 12:19:04 +01:00