Commit graph

15674 commits

Author SHA1 Message Date
Xin LI
660be17a01 file: Support testing multiple magic files.
This is based on upstream b74150490be904801378b2712fe0d532e1700124
but adapted to ATF.

Reviewed by: jlduran@gmail.com, markj, vangyzen
Differential Revision: https://reviews.freebsd.org/D42129

(cherry picked from commit 8f75390c66bdcde95e1b383aecaa27b4adf88279)
2023-11-03 23:05:19 -04:00
Jose Luis Duran
c3ca5da36e file_test: Fix file test
Trimming of the line feed is no longer necessary after
d993c6b0db

Currently the tests:

  - bcachefs2
  - gpkg-1-zst
  - multiple

are failing, but a fix will be committed upstream.

This also reverts c5e957ad4 "file: fix test case for gpkg by removing the extra \n."

MFC after:	3 days

(cherry picked from commit 0d3a87569f14b0e48826bbaab5e05f35669bcebf)
2023-11-03 23:05:19 -04:00
John Baldwin
260bab9f1e Purge more stray embedded $FreeBSD$ strings
These do not use __FBSDID but instead use bare char arrays.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D41957

(cherry picked from commit eba230afba4932f02a1ca44efc797cf7499a5cb0)
2023-10-24 10:10:12 -07:00
John Baldwin
a74d0e30bf factor: Remove an empty #ifdef __FBSDID clause
(cherry picked from commit f2f73fa7bd4b24c22ced0ff4566e03115dc9cb5f)
2023-10-24 10:02:32 -07:00
Jose Luis Duran
9ed4f43bc4 Remove $FreeBSD$: one line sh-pattern
Remove the $FreeBSD$ pattern added to the tests, as well as fixing the
mkimg_test.sh script to stop adding it when we rebase the tests.

Reviewed by: imp, emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/870

(cherry picked from commit 3b5c9845727a1b95098379f66223525e85e8a73f)
2023-10-18 09:24:00 -06:00
Warner Losh
524225dde0 mkimg: Regenerate all the tests for gpt
Recent changes to mkimg has changed the generated GPT images to be more
correct. Use make rebase to regenerate the baseline.

Sponsored by:		Netflix

(cherry picked from commit d2abbfede5342b19f3e5994140cdb6622c95ef66)
2023-10-18 09:23:41 -06:00
Warner Losh
4a3cdf4168 mkimg_test: remove vtoc8 images, they aren't needed
vtoc8 support expired with sparc64 removal, so remove them all.

Sponsored by:		Netflix

(cherry picked from commit 83bd5a833c3a14b74736e7b3fa0be66252a5a3dc)
2023-10-18 09:23:41 -06:00
Warner Losh
5401ebd33c mkimg: Ensure GPT Entry Array is at least 16k
UEFI v2.10 Section 5.3 documentes that the minimum reserved space after
the GPT header be at least 16kB. Enforce this minimum. Before, we'd only
set the number of entries to be the unpadded size. gpart's selective
enforcement of aspects of the GPT standard meant that these images would
work, but couldn't be changed (to add a partition or grow the size of a
partition). This ensures that gpart's overly picky standards don't cause
problems for people wishing to, for example, resize release images.

MFC after:		1 day (we want this in 14.0)
PR:			274312
Sponsored by:		Netflix
Reviewed by:		emaste
Differential Revision:	https://reviews.freebsd.org/D42245

(cherry picked from commit 9b42d3e12ffc6896fcb4e60c1b239ddf60705831)
2023-10-18 09:23:40 -06:00
Ed Maste
38521270cd fortune: use 115200 in serial example
Commit 4722ceb7d5 switched the default serial rate to 115200 bps.
Follow suit in the freebsd-tips fortune example.

Reviewed by:	bcr
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D41495

(cherry picked from commit aaff6a85ff1e506e38a8c4f94f1cb1065427e8c3)
2023-10-13 10:13:38 -04:00
Ed Maste
272bc4597d Add mitigations(7) describing our vulnerability mitigations
This is an initial take on documenting vulnerability mitigations.

Connect mitigations(7) to the build

Also add some cross references.

Reviewed by:	gbe (earlier)
Sponsored by:	The FreeBSD Foundation
Co-authored-by: Olivier Certner <olce.freebsd@certner.fr>
Differential Revision: https://reviews.freebsd.org/D41794

(cherry picked from commit b6a61ac2d475fba9c45f7f407549a522f60dea18)
(cherry picked from commit 6e5dcc6113da649a79e5bc2c3ea9329bcd1d85d5)
(cherry picked from commit a2b289608d6b54b6e1ce85096560807e551bb5ac)
2023-10-10 09:34:31 -04:00
Dag-Erling Smørgrav
b3cef2d2f5 split: Further option parsing improvements.
* Whenever possible, use strtonum() to parse numeric arguments.
* Improve usefulness and consistency of error messages.
* While here, fix some type and style issues.

Sponsored by:	Klara, Inc.
Reviewed by:	christos, kevans
Differential Revision:	https://reviews.freebsd.org/D42010

(cherry picked from commit d7399551b02861b910b15c7b7a78a2835644aa45)

split: Improve GNU compatibility.

* Like GNU split, turn autoextend back on if given -a0.
* Add a test case that verifies that -a<non-zero> turns autoextend off.
* Add a test case that verifies that -a0 turns autoextend back on.

Sponsored by:	Klara, Inc.
Reviewed by:	christos, kevans
Differential Revision:	https://reviews.freebsd.org/D42011

(cherry picked from commit d9d69a6f6fc1f8d80df9ce6493e8ab9388781615)
2023-10-05 01:59:44 +02:00
Ed Maste
2871b8a185 bspatch: use C23 overflow checking math now that it is available
Reviewed by:	des
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D41771

(cherry picked from commit ee12faa062c04a49bf6fe4e6867bad8606e2413f)
2023-09-25 09:45:06 -04:00
Wolfram Schneider
b8acbf4176 switch groff parameter -man to -mandoc for new groff release 1.23.0
PR: 273565

(cherry picked from commit cd89fe3923e92ab090cbdff7eb215c2d85b51718)
2023-09-25 09:51:13 +00:00
Wolfram Schneider
7f9f152307 switch groff parameter -man to -mandoc
groff 1.23.0 changed the semantics of the -man parameter, and many
manual pages are not rendered. The -mandoc parameter brings back
the old behavior, as in groff 1.22.4 and earlier.

PR: 273565, 273245

Reviewed by:	emaste, bapt
MFC after: 1 week for all supported branches (stable/12, 13, 14)
Differential Revision:	https://reviews.freebsd.org/D41737

(cherry picked from commit 035f7c9a3653d91564a5513f1311aa3b6e14a17e)
2023-09-25 09:47:49 +00:00
Ed Maste
84266fb897 Add deprecation notices to publickey(5) tools
Reviewed by:	imp, manu
MFC after:	3 days
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D40144

(cherry picked from commit d5ef73a71f0e2fbc4dc9b907a6e59a15599c50b3)
2023-09-22 20:34:09 -04:00
Mateusz Piotrowski
bd7273bc7f at.man: Move examples to the EXAMPLES section
MFC after:	3 days

(cherry picked from commit cd056e3cd4e421fd50245bb2aa6f989b23e861bc)
2023-09-22 14:41:29 +02:00
Mateusz Piotrowski
bffb55dc75 at.man: Fix mdoc(7) macro usage
MFC after:	3 days

(cherry picked from commit d13b8b3e7255ad01b25ab512983af88d78fc1e53)
2023-09-22 14:41:29 +02:00
Dag-Erling Smørgrav
24b741db5f grep: Suppress EISDIR when reading.
MFC after:	1 week
Sponsored by:	NetApp, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	kevans

(cherry picked from commit caf5283fc92edb83173752b1dafbc6d586e78815)
2023-09-14 08:56:45 +00:00
Kyle Evans
dc8ee27074 localedef: add newlines to error messages
These won't be added elsewhere, so add a little bit of room to make
these messages a little easier to read.  The existing set is a mixed
bag, there are somewhere in the ballpark of 45, 46 printfs to stderr and
19 of those had newlines.

Reviewed by:	yuripv
Sponsored by:	Klara, Inc.

(cherry picked from commit 3141e51d2e38fa7b9e6d81477dfa860d087c514d)
2023-09-08 22:52:58 -05:00
Kyle Evans
8d98eb4e51 localedef: correct definition of right-parenthesis in default charmap
It turns out that right parentheses do exist and are different than
left parentheses, so let's switch to that.

Sponsored by:	Klara, Inc.

(cherry picked from commit 07bc20e4740d09f554c3787bb1940fc503300822)
2023-09-08 22:52:54 -05:00
Dag-Erling Smørgrav
c3ae84bc2a include: Implement N2867.
This adds macros for checked addition, subtraction, and multiplication with semantics similar to the builtins gcc and clang have had for years.

Reviewed by:	kib, emaste
Differential Revision:	https://reviews.freebsd.org/D41734

(cherry picked from commit e6615b10347caf67f5bc12c9a8e30b8ddd9860ae)

include: Add tests for N2867.

Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D41735

(cherry picked from commit 4fbb9c43aa44d9145151bb5f77d302ba01fb7551)

less: We have <stdckdint.h> now.

Reviewed by:	delphij
Differential Revision:	https://reviews.freebsd.org/D41736

(cherry picked from commit cb8dd292c7ec53391dfa25847858dd7ef895f94e)

Approved by:	re (gjb)
2023-09-07 20:28:31 +00:00
Dag-Erling Smørgrav
0171f9ccfe unifdef: Handle redefined symbols correctly.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D41758

(cherry picked from commit aacbe7384221d2eafa326864bbbe2f22a10063ce)

Approved by:	re (gjb)
2023-09-07 20:28:31 +00:00
Dag-Erling Smørgrav
43e873278f split: Add missing test cases.
This adds test cases for c4f7198f47 and ac17fc816e.

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

(cherry picked from commit cbea5eddb1b6ae2a101beacf00bf165517f4f2b1)

split: Code cleanup.

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

(cherry picked from commit 851bf856d1a7ad5427ea9c22639ab6f6c4a3f503)

split: Fix linecount parsing.

The “undocumented kludge” which unfortunately can't be dropped for backward compatibility reasons was prone to segfaulting and would improperly allow a new linecount when one was already set.  Fix these issues and add regression tests.

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

(cherry picked from commit 117c54a78ccd214c236806721f21da750e512d3e)

Approved by:	re (gjb)
2023-09-07 20:28:31 +00:00
Mark Johnston
d5b5497e10 m4 tests: Update tests after $FreeBSD$ removal
Fixes:	d54a7d3373 ("Remove $FreeBSD$: one-line m4 tag")
2023-08-23 15:44:36 -04:00
Dag-Erling Smørgrav
7addfafe73 unifdef: Vendorize. 2023-08-21 19:52:27 +02:00
Dag-Erling Smørgrav
e738085b94 Remove my middle name. 2023-08-17 15:08:30 +02:00
Warner Losh
6ef644f588 Remove $FreeBSD$: one-line lua tag
Remove /^--\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:34 -06:00
Warner Losh
ae992a336e Remove $FreeBSD$: one-line catalog
Remove /^\s*\$\s*\$FreeBSD\$$\n/
2023-08-16 11:55:26 -06:00
Warner Losh
05248206f7 Remove $FreeBSD$: one-line bare tag
Remove /^\s*\$FreeBSD\$$\n/
2023-08-16 11:55:20 -06:00
Warner Losh
b2c76c41be Remove $FreeBSD$: one-line nroff pattern
Remove /^\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:15 -06:00
Warner Losh
fa9896e082 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:10 -06:00
Warner Losh
d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh
c857356409 Remove $FreeBSD$: alt one-line .c pattern
Remove /^\s*__RCSID\("\$FreeBSD\$"\);\n/
2023-08-16 11:54:53 -06:00
Warner Losh
da5432eda8 Remove $FreeBSD$: alt two-line .c pattern
Remove /^\s*__RCSID\("\$FreeBSD\$"\);\n\n/
2023-08-16 11:54:48 -06:00
Warner Losh
1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh
e5d258c9e5 Remove $FreeBSD$: two-line .c pattern
Remove /^#include\s+<sys/cdefs.h>.*$\n\s+__FBSDID\("\$FreeBSD\$"\);\n/
2023-08-16 11:54:34 -06:00
Warner Losh
2a63c3be15 Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16 11:54:29 -06:00
Warner Losh
42b388439b Remove $FreeBSD$: one-line .h pattern
Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:23 -06:00
Warner Losh
b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Warner Losh
d54a7d3373 Remove $FreeBSD$: one-line m4 tag
Remove /^dnl\s*\$FreeBSD\$.*$\n/
2023-08-16 11:54:09 -06:00
Doug Rabson
3af3571ca5 netstat(1): fix manpage date
MFC after:	1 week
2023-08-16 15:13:42 +01:00
Doug Rabson
182e8ae26d netstat(1): teach netstat to attach to jails
Add -j <jail> flag to netstat(1) to allow access to network information
from a jail.

MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D41446
2023-08-16 14:05:13 +01:00
Warner Losh
bf46512a54 systat: Remove obsolete copyright string
This is unused, so remove it. We don't put a copyright string in most of
the other binaries. This one doesn't need one either.

Sponsored by:		Netflix
2023-08-15 21:22:50 -06:00
Ed Maste
bfe6a0afaa etdump: warn only once for non El Torito bootable ISO images
Sponsored by:	The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D39869
2023-08-15 09:40:39 -04:00
Xin LI
f80a33ea41 MFV: less v643.
MFC after:	2 weeks
2023-08-13 00:13:31 -07:00
Enji Cooper
f05948d4e9 cpuset(8): move to /bin/
Summary:
This change moves /usr/bin/cpuset to /bin/cpuset so it is more readily
available on hosts where the /usr partition might not be mounted at the
time / has been mounted.

Remove some complexity from rc.subr(8) since /bin is assumed to always
be present if/when / is mounted.

MFC after:	2 weeks
MFC with:	0661f93892, 271d552379af

Test Plan:
- Test out rc.subr change.
- Confirm that the installation logic does what's needed.

Relnotes:	yes (moving cpuset may impact strict file permissions/mode checking)
Reviewers:	kevans
Subscribers:	imp
Differential Revision: https://reviews.freebsd.org/D40057
2023-08-11 00:49:02 -07:00
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