Commit graph

15944 commits

Author SHA1 Message Date
Bram
674b96f58b netstat: Add missing "shutdown-ack-timer" key to libxo output
The key "shutdown-timer" was present twice in the libxo output. The second
occurence of "shutdown-time" has been renamed to "shutdown-ack-timer".

PR: 254672
Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/1331
2024-09-20 09:06:50 -06:00
Bram
94567c8641 netstat: Resolve duplicate "dropped-packets" key from libxo output
The current libxo output uses the "dropped-packets" key for both incoming and
outgoing packets. This commit distinguishes between the two by adding an "in"
and "out" suffix. The original "dropped-packets" key is kept for backwards
compatibility for now.

PR: 244589
Reviewed by: imp, zlei
Pull Request: https://github.com/freebsd/freebsd-src/pull/1331
2024-09-20 09:06:26 -06:00
Konstantin Belousov
80133d678e procstat: support RLIMIT_PIPEBUF
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46619
2024-09-20 09:46:07 +03:00
Konstantin Belousov
b029e29e0d login.conf: add a placeholder for the pipebuf limit
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46619
2024-09-20 09:46:07 +03:00
Konstantin Belousov
f54f41403d usr.bin/limits: support RLIMIT_PIPEBUF
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46619
2024-09-20 09:46:07 +03:00
Stephen J. Kiernan
0a88678fca awk: update dependencies for dirdeps build
When building "awk" for the host, we need yacc to also exist
2024-09-18 13:04:43 -04:00
Konstantin Belousov
e3b777534b procstat(1): make rlimit_param[] size assertion automatic
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46619
2024-09-15 09:30:13 +03:00
Brooks Davis
7ca260df8c proccontrol: use a table for modes
Add a central table of modes and loop over it rather than spelling out
10 essentialy identical strcmp if statemnts.  Use the stable to generate
usage as well reducing the number of ifdefs.

Disallow multiple -m options.  Previouly multiple were allowed, but only
the last one was used and there was no indication this happened.

Reviewed by:	kib, markj
Differential Revision:	https://reviews.freebsd.org/D46426
2024-09-12 12:35:04 +01:00
Mark Johnston
b76961e3a2 kdump: Print splice structures
MFC after:	3 months
Sponsored by:	Klara, Inc.
Sponsored by:	Stormshield
2024-09-10 16:52:01 +00:00
Mark Johnston
051a2132f4 sockstat: Show the address of the spliced socket when -I is specified
MFC after:	3 months
Sponsored by:	Klara, Inc.
Sponsored by:	Stormshield
Differential Revision:	https://reviews.freebsd.org/D46413
2024-09-10 16:52:01 +00:00
Eugene Grosbein
7a6309fdc7 fetch(1): suppress "Not Modified" in quiet mode
"fetch -qi" should skip printing "Not Modified" for successful
http(s) request. Still print it by default (v_level == 1).

MFC after:	1 week
2024-09-07 09:14:23 +07:00
Jose Luis Duran
9cb98ab7ce getaddrinfo.{1,3}: Cross-reference ip6addrctl(8)
Reviewed by: imp, glebius
Pull Request: https://github.com/freebsd/freebsd-src/pull/1375
2024-09-06 12:34:32 -06:00
Bram
5c4f64bded netstat: Add version information to libxo output
Add version information to libxo output so that
libxo content consumers can track changes.

Reviewed by: imp, markj
Pull Request: https://github.com/freebsd/freebsd-src/pull/1350
2024-09-06 12:34:31 -06:00
Bram
6e6da53898 wc: Add version information to libxo output
Add version information to libxo output so that
libxo content consumers can track changes.

Reviewed by: imp, markj
Pull Request: https://github.com/freebsd/freebsd-src/pull/1350
2024-09-06 12:34:31 -06:00
Bram
5321a35479 w: Add version information to libxo output
Add version information to libxo output so that
libxo content consumers can track changes.

Reviewed by: imp, markj
Pull Request: https://github.com/freebsd/freebsd-src/pull/1350
2024-09-06 12:34:31 -06:00
Bram
31ac880688 iscsictl: Add version information to libxo output
Add version information to libxo output so that
libxo content consumers can track changes.

Reviewed by: imp, markj
Pull Request: https://github.com/freebsd/freebsd-src/pull/1350
2024-09-06 12:34:30 -06:00
Bram
71978fa41f du: Add version information to libxo output
Add version information to libxo output so that
libxo content consumers can track changes.

Reviewed by: imp, markj
Pull Request: https://github.com/freebsd/freebsd-src/pull/1350
2024-09-06 12:34:30 -06:00
John Baldwin
fc12c191c0 grep: Default to -p instead of -S.
This matches the documented behavior in the manpage as well as the
default behavior on macOS.

PR:		280676
Reported by:	Radosław Piliszek <radoslaw.piliszek@gmail.com>
Reviewed by:	kevans
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D46256
2024-09-04 15:53:22 -04:00
John Baldwin
77eb877714 grep: Fix various bugs in recursive tree handling
The -OpS options were effectively ignored due to a collection of
bugs in the use of fts(3):

- fts_open(3) requires one of FTS_PHYSICAL or FTS_LOGICAL to be
  specified, but in the -O case, only FTS_COMFOLLOW was given.  Fix
  this to use FTS_COMFOLLOW | FTS_PHYSICAL.

- The switch on the entry type returned by fts_read() did not check
  for symbolic links, so symbolic links fell into the default case and
  were always passed to procfile() even when -p was given.  Fix this
  by adding cases in the switch statement to explicitly ignore FTS_SL.

- FTS_NOSTAT was passed to fts_open(), so fts_open() couldn't detect
  symbolic links when FTS_PHYSICAL was passed, instead both regular
  files and symbolic links were returned as FTS_NSOK entries.  Fix
  by only using FTS_NOSTAT with FTS_LOGICAL.

While here, fix a few other nits:

- Treat FTS_NS as an error like FTS_DNR and FTS_ERR.

- Just ignore FTS_DP.  The logic to skip descending into skipped
  directories is only relevant when a directory is first visited, not
  after the directory has been visited.

- Use warnc instead of warnx + strerror.

PR:		280676
Reviewed by:	kevans
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D46255
2024-09-04 15:53:17 -04:00
Poul-Henning Kamp
4dabfcb615 Typo.
Spotted by: ktullavik
2024-09-03 16:00:17 +00:00
Ed Maste
83325e7b73 beep: show error upon failure to open sound device
If beep cannot open /dev/dsp provide more information to aid the user
in diagnosing a problem.

Reviewed by:	christos
Sponsored by:	The FreeBSD Foundation
2024-09-03 10:27:43 -04:00
Poul-Henning Kamp
ffaf862df6 Mention that SILI makes tcopy(1) slow on modern tape drives 2024-09-03 10:44:20 +00:00
Bram Ton
c7dd97ec99 vmstat: Add root element to libxo output
Current libxo output does not have a root element. Valid XML requires a single
root element. This commit adds this root element.

The libxo output version bumped accordingly.

PR:		254635
MFC after:	1 week
Pull Request: https://github.com/freebsd/freebsd-src/pull/1330
2024-09-02 18:22:14 -07:00
Dag-Erling Smørgrav
f62c1f3f8e locate.updatedb: Explicitly exit from trap code.
When a signal is trapped, the script continues after the trap code has
run, unless the trap code explicitly exits.  In the particular case of
locate.updatedb, this is mostly harmless, except that the trap code is
executed twice (once for the signal and once when we reach the end of
the script), but it's still worth fixing.

Furthermore, install the trap as soon as we've created the temporary
directory, to minimize the window during which we can fail to clean up
after ourselves if interrupted.

While here, simplify the empty check at the end and make some minor
style tweaks.

MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D46475
2024-08-29 17:05:47 +02:00
Igor Ostapenko
199544c990 calendar: Add myself to calendar.freebsd
Approved by:	markj (mentor), kp (mentor)
2024-08-27 02:25:22 +00:00
Brooks Davis
5cbb98c825 proccontrol.1: bump doc date
Fixes:		70174ef7d2 proccontrol: make -s require a target
2024-08-23 18:59:46 +01:00
Brooks Davis
70174ef7d2 proccontrol: make -s require a target
Require a command to exec or a pid to target and update usage and the
manpage to make this more clear.

It makes no sense to invoke a procctl(2) command on the current process
only to exit.  Users are sometimes confused about how proccontrol works
and think it effects their shell environment when invoked without a
target.  Disallowing this nonsensical behavior and clarifiying usage
will hopefully reduce confusion.

Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D46422
2024-08-23 18:57:59 +01:00
Andre Albsmeier
308399a179 tail -F: fix crash
When show() detects an error and closes the file and follow() wants to
close it again, a NULL dereference occurs.

PR:	280910
MFC after:	1 week
2024-08-19 10:54:24 +03:00
Poul-Henning Kamp
06758ab134 Use expand_number(3) for less confusing argument processing 2024-08-08 21:22:39 +00:00
Kyle Evans
6cb8b61efe calendar: don't setlogin(2) in the -a user handlers
As of e67975d331 ("Fix 'calendar -a' in several ways."), `calendar -a`
will now fork off a new process for each user and do all of its own
processing in the user's own context.

As a side-effect, calendar(1) started calling setlogin(2) in each of the
forked processes and inadvertently hijacked the login name for the
session it was running under, which was typically not a fresh session
but rather that of whatever cron/periodic run spawned it.  Thus, daily
and security e-mails started coming from completely arbitrary user.

We could create a new session, but it appears that nothing calendar(1)
does really needs the login name to be clobbered; opt to just avoid the
setlogin(2) call entirely rather than incur the overhead of a new
session for each process.

PR:		280418
Reviewed by:	des, olce
Fixes:		e67975d331 ("Fix 'calendar -a' in several ways.")
Differential Revision:	https://reviews.freebsd.org/D46095
2024-08-05 13:43:56 -05:00
Ed Maste
5c2bc3db20 Remove "All Rights Reserved" from FreeBSD Foundation copyrights
These ones were unambiguous cases where the Foundation was the only
listed copyright holder.

Sponsored by:	The FreeBSD Foundation
2024-07-30 12:16:36 -04:00
Bram
1d551845f3 netstat.1: Clarify -d argument
The man page states that the -d flag can be used to show the dropped
packets. But, the number of dropped input packets are always shown,
independent of the -d flag. This commit clarifies that the -d flag will
add the number of dropped output packets to the output.

MFC after: 3 days
Reviewed by: imp, Alexander Ziaee
Pull Request: https://github.com/freebsd/freebsd-src/pull/1332
2024-07-29 14:07:11 -06:00
Dag-Erling Smørgrav
9317242469 diff: Fix integer overflow.
The legacy Stone algorithm uses `int` to represent line numbers, array
indices, and array lengths.  If given inputs approaching `INT_MAX` lines,
it would overflow and attempt to allocate ridiculously large amounts of
memory.  To avoid this without penalizing non-pathological inputs,
switch a few variables to `size_t` and add checks while and immediately
after reading both inputs.

MFC after:	3 days
PR:		280371
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D46169
2024-07-29 16:02:29 +02:00
Dag-Erling Smørgrav
ca75b7dac8 sdiff: Fix usage message.
The `--ignore-all-space` option was incorrectly documented as
`--ignore-all-spaces`.

MFC after:	3 days
Sponsored by:	Klara, Inc.
Reviewed by:	0mp, markj
Differential Revision:	https://reviews.freebsd.org/D46161
2024-07-29 16:02:25 +02:00
Dag-Erling Smørgrav
ab830de9f5 diff: Fix usage message and documentation.
The `--ignore-all-space` option was incorrectly documented as
`--ignore-all-blanks` in some (but not all) places.

MFC after:	3 days
PR:		280434
Sponsored by:	Klara, Inc.
Reviewed by:	0mp, markj
Differential Revision:	https://reviews.freebsd.org/D46160
2024-07-29 16:02:21 +02:00
Michael Tuexen
646c28ea80 tcp: improve SEG.ACK validation
Implement the improved SEG.ACK validation described in RFC 5961.
In addition to that, also detect ghost ACKs, which are ACKs for data
that has never been sent.
The additional checks are enabled by default, but can be disabled
by setting the sysctl-variable net.inet.tcp.insecure_ack to a
non-zero value.

PR:			250357
Reviewed by:		Peter Lei, rscheff (older version)
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D45894
2024-07-21 11:37:35 +02:00
Konstantin Belousov
35f4984343 sockstat(1): tolerate situation where file info cannot be fetched
Either due to a race, or to the privilege restrictions, it is not
guaranteed that kern.files returned file information for all pcbs
read from net.inet.<proto>.pcblist.  In this case the file rbtree does
not return the matching file by data address, and code must avoid
dereferencing NULL.

PR:	279875
Reviewed by:	asomers
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D46050
2024-07-21 11:51:42 +03:00
Simon J. Gerraty
226192822c Merge bmake-20240711
Merge commit '84691af93185c692058ba55fa81a04103f5bf71b'
2024-07-20 12:45:48 -07:00
John Baldwin
a971c60456 ministat: Consistently use item count as the first argument to calloc
Reported by:	GCC 14 -Wcalloc-transposed-args
Reviewed by:	rlibby, emaste
Differential Revision:	https://reviews.freebsd.org/D46011
2024-07-19 13:06:38 -04:00
Igor Ostapenko
257e70f1d5 kyua: Add FreeBSD Jail execution environment support
A new Kyua concept is added -- "execution environment". A test can be
configured to be run within a specific environment. The test case
lifecycle is extended respectively:
- execenv init (creates a jail or does nothing for default
  execenv="host")
- test exec
- cleanup exec (optional)
- execenv cleanup (removes a jail or does nothing for default
  execenv="host")

The following new functionality is provided, from bottom to top:

1 ATF based tests

- The new "execenv" metadata property can be set to explicitly ask for
  an execution environment: "host" or "jail". If it's not defined, as
  all existing tests do, then it implicitly means "host".

- The new "execenv.jail.params" metadata property can be optionally
  defined to ask Kyua to use specific jail(8) parameters during creation
  of a temporary jail. An example is "vnet allow.raw_sockets".

  Kyua implicitly adds "children.max" to "execenv_jail_params"
  parameters with the maximum possible value. A test case can override
  it.

2 Kyuafile

- The same new metadata properties can be defined on Kyuafile level:
  "execenv" and "execenv_jail_params".

- Note that historically ATF uses dotted style of metadata naming, while
  Kyua uses underscore style. Hence "execenv.jail.params" vs.
  "execenv_jail_params".

3 kyua.conf, kyua CLI

- The new "execenvs" engine configuration variable can be set to a list
  of execution environments to run only tests designed for. Tests of not
  listed environments are skipped.

- By default, this variable lists all execution environments supported
  by a Kyua binary, e.g. execenvs="host jail".

- This variable can be changed via "kyua.conf" or via kyua CLI's "-v"
  parameter. For example, "kyua -v execenvs=host test" will run only
  host-based tests and skip jail-based ones.

- Current value of this variable can be examined with "kyua config".

[markj] This feature has not landed upstream yet.
See the discussion in https://github.com/freebsd/kyua/pull/224 .
Having the ability to automatically jail tests allows many network tests
to run in parallel, giving a drastic speedup.  So, let's import the
feature and start using it in main.

Signed-off-by:  Igor Ostapenko <pm@igoro.pro>
Reviewed by:    markj, kp
Tested by:      markj, kp
MFC after:	3 months
Differential Revision:  https://reviews.freebsd.org/D45865
2024-07-18 09:18:28 -04:00
Warner Losh
e9ac41698b Remove residual blank line at start of Makefile
This is a residual of the $FreeBSD$ removal.

MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
2024-07-15 16:43:39 -06:00
Mark Johnston
498b3b494b lockf tests: Fix a race
The test launches lockf(1) in the background and races with it, so it
shouldn't be using atf_check to check that lockf won the race.

MFC after:	1 week
2024-07-14 14:29:14 -04:00
Alexander Ziaee
cb18ba9df5 time.1: minor cleanup (alignment/macro/spdx)
+ shorter example filename to minimize line wrap
+ standards macro clarifying posix => posix.2
+ align options + tag spdx

Reviewed by:	mhorne
MFC after:	3 days
Pull-Request:	https://github.com/freebsd/freebsd-src/pull/1315
2024-07-12 11:16:39 -03:00
Valentine Astakhov
8c108b341c ncal: add -M to start week on Monday in cal mode
MFC after: 2 weeks
Reviewed by: imp, Alexander Ziaee,
Pull Request: https://github.com/freebsd/freebsd-src/pull/1294
2024-07-07 05:55:36 -06:00
Dag-Erling Smørgrav
4ce4a0fe14 diff: Document the --no-dereference option.
Also, --no-dereference should not imply --recurse.

MFC after:	3 days
Sponsored by:	Klara, Inc.
Reviewed by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D45779
2024-06-30 17:55:27 +02:00
Simon J. Gerraty
8d5c8e21c6 Merge bmake-20240625
Merge commit 'dbb5be7f07456d02ce444484c683b130439acb45'
2024-06-28 17:22:11 -07:00
Alexander Ziaee
a85d870007 man.sh: revert trapping SIGPIPE
PR:		279542
Fixes:		14a5c1068d
Reported by:	emaste
Reviewed by: imp, emaste, jilles
Pull Request: https://github.com/freebsd/freebsd-src/pull/1283
2024-06-27 18:34:33 -06:00
Baptiste Daroussin
35e941ce55 systat: fix build with newer ncurses 2024-06-20 15:10:38 +02:00
Baptiste Daroussin
21817992b3 ncurses: vendor import version 6.5 2024-06-20 13:26:22 +02:00
Mark Johnston
d9220f64da uniq tests: Make uniq_test:stdout more reliable
When running regression tests in paralle, this one occasionally fails
because uniq exits with status 0.  I believe this is because the test is
a bit racy: it assumes that true(1) will exit before uniq writes to
standard out.

Just sleep for a bit to give the other end of the pipe to exit.

Reviewed by:	des
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D45534
2024-06-13 20:00:47 -04:00