Commit Graph

15628 Commits

Author SHA1 Message Date
Enji Cooper
c45e66dca3 Unbreak usr.bin/dc with OpenSSL 3
OpenSSL's BN_zero API has had a void return value since 1.1.x: chase the
change to unbreak the build on OpenSSL 3.x with MK_GH_BC == no.

MFC after:	2 weeks
Reviewed by:	emaste, kevans
Differential Revision:	https://reviews.freebsd.org/D41410
2023-08-10 23:33:44 -07:00
Poul-Henning Kamp
4ff782c06a tcopy: Pick up max blocksize from sysctl kern.maxphys 2023-08-10 14:58:18 +00:00
Pedro F. Giffuni
9610cbc09e patch: don't run off the end of path if it ends in '/'.
Found by fuzzing (afl) in OpenBSD.

Obtained from:	OpenBSD (CVS 1.65)
2023-08-06 22:27:27 -05:00
Martin Matuska
b5a3a89c50 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)
MFC after:		1 month
2023-08-04 12:45:41 +02:00
Ed Maste
8a5c836b51 man: fix man -K search
Quote re arg to grep in case it has spaces, and quote [:blank:] tr arg
to avoid the shell interpreting [].

PR:		272729
Reviewed by:	Mina Galić <freebsd@igalic.co>
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41282
2023-08-02 16:46:57 -04:00
Ed Maste
77f6be4484 retire SHARED_TOOLCHAIN knob
Toolchain components were historically statically linked.  They became
normal dynamically linked executables in commit 6ab18ea64d.  There is
no need to keep a special case build option for the toolchain; users who
want statically linked toolchain (or any other) components can use the
existing NO_SHARED knob.

Reviewed by:	dim, sjg
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41266
2023-08-01 20:13:22 -04:00
Mark Johnston
2682a15527 xargs tests: Disable the test added in commit eab91d0081
This test has been triggering OOM kills in CI runs since it triggers an
allocation of 16GB.  Temporarily disable the test until the problem is
solved one way or another.
2023-07-31 10:44:32 -04:00
Stefan Eßer
382af2f8d7 usr.bin/gh-bc: fix Makefile for WITHOUT_NLS_CATALOGS case
Some macro definitions had been moved into a Makefile section
that depends on MK_NLS_CATALOGS != "no", leading to LTO and the
installation of tests being disabled in the WITHOUT_NLS_CATALOGS
case.

Reported by:	Yuri <yuri@aetern.org>
2023-07-29 20:57:32 +02:00
Mike Karels
372e3d561d netstat -i: compute most field widths dynamically
The network and address fields were sometimes truncated for netstat -i
without -W, and often much too wide for netstat -i with the -W option.
Fields such as normal packet counts often overflowed.  As a result,
columns didn't line up, and large white spaces made it harder to
follow a line across the display.  Change the code to compute the
required field sizes for network, address, and various packet counts.
Hoist the code to format network and address into a subroutine that
can be called twice, once to measure the required field widths,
and once to emit the values.  Use separate field widths for input
and output packets, byte counts, and error and drop counters.
These are left at defaults (the preceding values) with the -h
option, in which case the fields have a limited total width.
An extra space is included between the Network and Address, which
otherwise seemed too close.

Change the mention of -W with -i in the man page to say that most
field widths are computed dynamically in this case.

MFC after:	1 week
Reviewed by:	sjg, glebius
Differential Revision:	https://reviews.freebsd.org/D41160
2023-07-26 10:56:52 -05:00
Marius Strobl
4ef1c6f75d base: Remove support for the VTOC8 partitioning scheme
The removal of the sparc64 support in February 2020 obsoleted the
VTOC8 partitioning scheme as no other FreeBSD platform makes use
of it. Moreover, the code is bitrotting as nothing defines e. g.
LOADER_VTOC8_SUPPORT any more and, thus, should go now, too. With
this change, the following commits are reverted as far as VTOC8
is concerned and parts haven't already previously been deleted
along with prior sparc64 removals:
094fcb157d
a7d366e958
ba8d50d08b

The alignment example d9711c28ef
added to the VTOC8 section of gpart.8 is folded into the MBR one.

This should finally conclude the deorbit of sparc64-specific bits.

        We had joy, we had fun
        we ran Unix on a Sun.
        But that source and the song
        of FreeBSD have all gone.

Credits to Michael Bueker for the original "Unix on a Sun" and Rod
McKuen for the "Seasons in the Sun" lyrics.
2023-07-26 13:16:12 +02:00
Dimitry Andric
f576172682 Move LIBADD lines from usr.bin/clang/*/Makefile one level up
Some utilities under usr.bin/clang were only linked to libz, while most
others were linked to libz and libzstd. Make this consistent, and remove
repetition, by moving these LIBADD lines to usr.bin/clang/clang.prog.mk
and usr.bin/clang/clang.prog.mk.

MFC after:	3 days
2023-07-23 22:04:55 +02:00
Ed Maste
8f8da1bcc7 seq: style(9) cleanup
This is in part for diff reduction with OpenBSD.

Sponsored by:	The FreeBSD Foundation
2023-07-21 10:17:24 -04:00
Dag-Erling Smørgrav
a122c3c492 unifdef: Fix case where a multiline comment follows a directive.
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D41026
2023-07-19 14:47:23 +00:00
Jessica Clarke
587458b7d6 rpcgen: Perform shell-style word expansion on RPCGEN_CPP
Up until recently, CPP has been a list of space-separated words, with no
quotes, backslashes or other characters with special meaning to a shell.
However, as of 8fad2cda93, (escaped) quotes appear in CPP, and the
rudimentary parser in rpcgen is insufficient, since it will leave the
escaped quotes as escaped rather than performing one level of expansion
as would be done by a shell (whether in a script or a Makefile).

Rather than hack around this in all the places RPCGEN_CPP gets set,
implement proper expansion inside rpcgen. Note that this only deals with
a subset of shell syntax, since we don't handle any of:

  | & ; < > ( ) $ ` * ? [ # ˜ = %

having special meaning (with the exception of how a backslash behaves
inside double quotes, where \$ means a literal $ inside double quotes
but \a means a literal \a), instead using their literal value, but those
are all reasonable restrictions, and can be worked around by avoiding
their use; what's important is that we get the quoting and splitting
right.

This fixes -Winvalid-pp-token spew during build${libcompat}.

Reviewed by:	brooks
Fixes:		8fad2cda93 ("bsd.compat.mk: Provide new CPP and sub-make variables")
Differential Revision:	https://reviews.freebsd.org/D41013
2023-07-14 02:35:25 +01:00
Jose Luis Duran
d234c8228c xargs: Install missing test output.
Fixes:		eab91d0081
MFC after:	1 week
Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D41033
2023-07-13 23:39:51 +00:00
Dag-Erling Smørgrav
c65845d0bb xargs: Fix test case count.
MFC after:	1 week
Sponsored by:	Klara, Inc.
2023-07-13 21:40:36 +00:00
Dag-Erling Smørgrav
eab91d0081 xargs: Prevent overflow in linelen calculation if nargs is large.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D41023
2023-07-13 21:35:23 +00:00
Daniel Tameling
1048a870e3 xargs: disallow -R0 and -L0
Both cases were interpreted as these flags are unset. This meant that
-R0 got converted to -R5 and that -L0 didn't have any effect at all.
Since make at most 0 replacements isn't useful and since call utility
for every 0 lines read doesn't make sense, throw an error for these
two cases.

MFC after:	1 week
Reviewed by:	des, kevans
Differential Revision:	https://reviews.freebsd.org/D41022
2023-07-13 21:35:23 +00:00
Daniel Tameling
202adb2236 xargs: fix -R so that it accepts negative numbers again
fbc445addf converted the parsing of arguments to strtonum but made
the accepted range for -R too restrictive. As documented in the man
page, it should accept negative numbers.

Added a test for this, which was provided by Jose Luis Duran.

Fixes:		fbc445addf
MFC after:	1 week
Reviewed by:	des, kevans
Differential Revision:	https://reviews.freebsd.org/D41021
2023-07-13 21:35:23 +00:00
Jessica Clarke
9d843ba324 rpcgen: Clarify behaviour for idx
The re-initialisation of idx in the later else branch is a bit hidden,
and results in deviation from the earlier two paths. Use more consistent
code instead to make it abundantly clear what's going on.
2023-07-13 06:22:59 +01:00
Jessica Clarke
e17dd921a2 ldd: Use __PATH_RTLD("32") over _COMPAT32_PATH_RTLD
This will allow the latter to be removed, reducing the boilerplate
needed for a new libcompat.

Reviewed by:	kib, brooks, jhb
Differential Revision:	https://reviews.freebsd.org/D40934
2023-07-09 18:50:24 +01:00
Martin Matuska
e64780fbc3 xinstall: do not use copy_file_range(2) when BOOTSTRAPPING
Reported by:	arichardson
2023-07-09 01:25:23 +02:00
Martin Matuska
5a50d52f11 xinstall: use copy_file_range(2) with fallback to previous behavior
This allows to use special filesystem features like server-side
copying on NFS 4.2 or block cloning on OpenZFS 2.2.

Note: copy_file_range(2) is not used when a digest calculation is
requested as this would require to read the input file twice.

Reviewed by:	asomers, imp, rmacklem
Differential revision:	https://reviews.freebsd.org/D40898
2023-07-08 21:51:21 +02:00
Alfonso Gregory
cccdaf507e Mark usage function as __dead2 in programs where it does not return
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735
2023-07-07 10:45:18 -06:00
Alfonso Gregory
1a7ac2bd24 Mark usage function as __dead2 in programs where it does not return
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735
2023-07-07 10:45:18 -06:00
Alfonso Gregory
a1b6427a97 Mark usage function as __dead2 in programs where it does not return
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735
2023-07-07 10:45:18 -06:00
Alfonso Gregory
498a0a9c61 Mark usage function as __dead2 in programs where it does not return
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735
2023-07-07 10:45:18 -06:00
Mohamed Akram
b35ea9bac9 man(1): use gzcat for .gz files
POSIX zcat appends the .Z suffix to file arguments causing the command to fail
with .gz files.

Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>

Reviewed by:	markj
MFC after:	2 weeks
Pull Request:	https://github.com/freebsd/freebsd-src/pull/789
2023-07-04 15:42:55 -04:00
Eugene Grosbein
5aee3e14d4 syslog.3: document ident[N] format
When libc switched to generation of logs as per RFC 5424,
that change broke application ability to insert specific process id
using ident[N] format, the feature existed for decades.
Some processes rely on it (including logger and syslogd).

Later the regression was fixed but the feature remained undocumented.
This change documents it.

MFC after:	1 week
2023-07-03 19:46:40 +07:00
Simon J. Gerraty
fcc8d72702 Separate dependencies on tools built for host.
When generated files depend on tools that need to be built for host,
we need to carefully separate them for the DIRDEPS_BUILD so we
only build them once.

Reviewed by:	stevek
Sponsored by:	Juniper Networks, Inc.
2023-06-29 23:52:03 -07:00
Dag-Erling Smørgrav
78baa63209 stdbuf: Code cleanup.
* Factor out path-setting code.
* Normalize usage().
* Remove unnecessary switch case.

Sponsored by:	Klara, Inc.
Reviewed by:	kevans, imp
Differential Revision:	https://reviews.freebsd.org/D40799
2023-06-29 15:30:05 +00:00
Dag-Erling Smørgrav
b5b9eaa962 Restore and document -ps / -nps option.
Sponsored by:	Klara, Inc.
Reviewed by:	pauamma_gundo.com, pstef, kevans
Differential Revision:	https://reviews.freebsd.org/D40788
2023-06-29 13:59:49 +00:00
Yuri Pankov
24ec316c13 Correctly spell illumos (all lowercase) in man pages
From illumos FAQ:

    "illumos (pronounced i-llu-MOS and written in lowercase)"
2023-06-29 13:14:45 +02:00
Simon J. Gerraty
148ee84570 Merge bmake-20230622
Merge commit '3e39ce563b9ba25883e5aa37d9799eda9e57c1e0'
2023-06-27 13:57:58 -07:00
Cy Schubert
e36b028933 systat: Chase 70ea484e3e, removing vdev_cache
As of 70ea484e3e vdev_cache has been removed. Stop reporting on it.
Without this systat reports:

	sysctl(kstat.zfs.misc.vdev_cache_stats.misses...) failed:
	No such file or directory

Reviewed by:		mav
Differential Revision:	https://reviews.freebsd.org/D40742
2023-06-27 11:34:29 -07:00
John Baldwin
1e80d4b188 xo: Disable -Wunused-but-set-variable.
Presumably these warnings will be fixed upstream at some point.

contrib/libxo/xo/xo.c:99:9: error: variable 'hflag' set but not used [-Werror,-Wunused-but-set-variable]
    int hflag = 0, jflag = 0, tflag = 0,
        ^
contrib/libxo/xo/xo.c:99:20: error: variable 'jflag' set but not used [-Werror,-Wunused-but-set-variable]
    int hflag = 0, jflag = 0, tflag = 0,
                   ^
contrib/libxo/xo/xo.c:99:31: error: variable 'tflag' set but not used [-Werror,-Wunused-but-set-variable]
    int hflag = 0, jflag = 0, tflag = 0,
                              ^
contrib/libxo/xo/xo.c💯2: error: variable 'zflag' set but not used [-Werror,-Wunused-but-set-variable]
        zflag = 0, qflag = 0, star1 = 0, star2 = 0;
        ^
contrib/libxo/xo/xo.c💯13: error: variable 'qflag' set but not used [-Werror,-Wunused-but-set-variable]
        zflag = 0, qflag = 0, star1 = 0, star2 = 0;
                   ^

Reviewed by:	sjg
Differential Revision:	https://reviews.freebsd.org/D40668
2023-06-27 10:19:32 -07:00
Warner Losh
a1db51dbdb unzip(1): Comma after e.g.
Add comma after e.g. to make igor happy (oh, and I suppose to conform to
normal English grammar rules).

Sponsored by:		Netflix
2023-06-27 10:58:40 -06:00
Mingye Wang
a227908571 unzip: add -O/-I encoding support
These are for compatibility with the info-zip version of unzip.

PR: 271657
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/752
2023-06-27 10:55:26 -06:00
Mohamed Akram
8edb6fb572 man(1): Support custom sections
PR: 271830
Signed-off-by: Mohamed Akram <mohd.akram@outlook.com>
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/764
2023-06-27 07:51:27 -06:00
Tom Hukins
e495600ce3 netstat(1): Use simpler language
Reviewed by: imp, Mina Galić
Pull Request: https://github.com/freebsd/freebsd-src/pull/771
2023-06-26 17:07:27 -06:00
Tom Hukins
3df959b5fe nohup(1): link to a related manual page
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/783
2023-06-26 16:36:25 -06:00
Ed Maste
5dae8905a5 seq: combine asprintf return value checks
Error handling is identical for all of these failure cases.

Sponsored by:	The FreeBSD Foundation
2023-06-25 19:57:17 -04:00
Benedict Reuschling
764464af49 Fix spelling of "behavior" to be consistent with the rest of the file 2023-06-23 05:48:01 +00:00
Dimitry Andric
a324c34037 Merge llvm-project release/16.x llvmorg-16.0.4-0-gae42196bc493
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16.0.4-0-gae42196bc493 (aka 16.0.4 release).

PR:		271047
MFC after:	1 month
2023-06-22 20:22:43 +02:00
Dimitry Andric
1ac55f4cb0 Merge llvm-project release/16.x llvmorg-16.0.1-0-gcd89023f7979
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16.0.1-0-gcd89023f7979 (aka 16.0.1 release).

PR:		271047
MFC after:	1 month
2023-06-22 20:22:20 +02:00
Dimitry Andric
bdd1243df5 Merge llvm-project main llvmorg-16-init-18548-gb0daacf58f41
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-16-init-18548-gb0daacf58f41.

PR:		271047
MFC after:	1 month
2023-06-22 20:20:56 +02:00
Dag-Erling Smørgrav
db4c5b8a05 m4: Miscellaneous man page fixes.
Sponsored by:	Klara, Inc.
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D40701
2023-06-21 20:59:03 +00:00
Dag-Erling Smørgrav
6c9ed64c94 m4: Add -G option which reverses -g.
This matches GNU m4's -G / --traditional option, and although BSD m4 in non-GNU mode is not exactly identical to GNU mode in traditional mode, it's close enough.

Sponsored by:	Klara, Inc.
Reviewed by:	kevans, imp
Differential Revision:	https://reviews.freebsd.org/D40697
2023-06-21 20:59:03 +00:00
Dag-Erling Smørgrav
47b32f8f93 m4: Support long options.
The option names are identical to those of the equivalent options in GNU m4, except of course for --gnu which does not exist in GNU m4.

While here, make the argument to -d / --debug optional, with the same default behavior as in GNU m4, and document it properly.

Sponsored by:	Klara, Inc.
Reviewed by:	kevans, imp
Differential Revision:	https://reviews.freebsd.org/D40694
2023-06-21 20:59:03 +00:00
Konstantin Belousov
5bd5470a2c top(8): restore erronously removed SWAIT array element
due to bad rebase.

Noted by:	kevans
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Fixes:	6a5e6a50bd55c3fb4933abe1edaad3a928700c42ESC
2023-06-21 08:43:11 +03:00