Commit graph

7111 commits

Author SHA1 Message Date
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
Jessica Clarke 949199a212 etc: Automatically generate BSD.lib${libcompat}.dist lists
Note that each libcompat still has its own file that must exist.

Reviewed by:	brooks, jhb
Differential Revision:	https://reviews.freebsd.org/D41182
2023-07-27 05:10:44 +01:00
Shivank Garg 215bab7924 mac_ipacl: new MAC policy module to limit jail/vnet IP configuration
The mac_ipacl policy module enables fine-grained control over IP address
configuration within VNET jails from the base system.
It allows the root user to define rules governing IP addresses for
jails and their interfaces using the sysctl interface.

Requested by:	multiple
Sponsored by:	Google, Inc. (GSoC 2019)
MFC after:	2 months
Reviewed by:	bz, dch (both earlier versions)
Differential Revision: https://reviews.freebsd.org/D20967
2023-07-26 00:07:57 +00:00
Doug Rabson 5ac2a874d0 /etc/rc.subr: rename sysctl.conf.d to sysctl.kld.d
This better reflects the intent that this directory is indexed by kld
name and removes a conflict with D32128 which aims to split sysctl.conf.

Reviewed by:	kevans imp
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D41043
2023-07-15 14:16:08 +01:00
Doug Rabson 09267cc152 /etc/rc.subr: add support for kld sysctl variables
For kernel modules loaded by scripts in /etc/rc.d and
/usr/local/etc/rc.d, if there is a file in /etc/sysctl.conf.d named <kld
name>.conf, then this will be loaded using the sysctl(8) utility. For
instance, sysctl variable changes for the pf kernel module would be
placed in the file /etc/sysctl.conf.d/pf.conf.

PR:		272129
Reviewed by:	imp freebsd_igalic.co
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D40886
2023-07-14 10:49:47 +01:00
Mitchell Horne 8ab2da6828 Remove GCC 4.2 include dirs
These are present (and empty) on a system installed post-GCC removal.

Reviewed by:	imp
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D40878
2023-07-10 10:16:13 -03:00
Li-Wen Hsu 2597c45a4f
Complete moving kinst of dtrace tests to common
Update its mtree entry.

Reviewed by:	christos, markj
Fixes:	911f026039 dtrace: move kinst tests to common
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D40901
2023-07-08 04:05:30 +08:00
Dimitry Andric 5de9420ad5 Create correct engines debug directory after OpenSSL 3.0.9 merge
PR:		271656
Fixes:		b077aed33b ("Merge OpenSSL 3.0.9")
2023-07-01 22:59:23 +02:00
Pierre Pronchery b077aed33b Merge OpenSSL 3.0.9
Migrate to OpenSSL 3.0 in advance of FreeBSD 14.0.  OpenSSL 1.1.1 (the
version we were previously using) will be EOL as of 2023-09-11.

Most of the base system has already been updated for a seamless switch
to OpenSSL 3.0.  For many components we've added
`-DOPENSSL_API_COMPAT=0x10100000L` to CFLAGS to specify the API version,
which avoids deprecation warnings from OpenSSL 3.0.  Changes have also
been made to avoid OpenSSL APIs that were already deprecated in OpenSSL
1.1.1.  The process of updating to contemporary APIs can continue after
this merge.

Additional changes are still required for libarchive and Kerberos-
related libraries or tools; workarounds will immediately follow this
commit.  Fixes are in progress in the upstream projects and will be
incorporated when those are next updated.

There are some performance regressions in benchmarks (certain tests in
`openssl speed`) and in some OpenSSL consumers in ports (e.g.  haproxy).
Investigation will continue for these.

Netflix's testing showed no functional regression and a rather small,
albeit statistically significant, increase in CPU consumption with
OpenSSL 3.0.

Thanks to ngie@ and des@ for updating base system components, to
antoine@ and bofh@ for ports exp-runs and port fixes/workarounds, and to
Netflix and everyone who tested prior to commit or contributed to this
update in other ways.

PR:		271615
PR:		271656 [exp-run]
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2023-06-23 18:53:36 -04: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 b7412da2e1 asa: Add some unit tests.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D40564
2023-06-15 19:24:59 +00:00
Alexander V. Chernikov 9f44a47fd0 ipfw(8): add ioctl/instruction generation tests
Differential Revision: https://reviews.freebsd.org/D40488
MFC after:	2 weeks
2023-06-13 11:55:37 +00:00
Jessica Clarke dfa1982352 etc: Don't create stray directories in NO_ROOT distrib-dirs
The loop above is responsible for creating the actual directories,
whilst this one is just responsible for creating the corresponding
METALOG. Since DESTDIR already includes DISTBASE, this results in
creating a second set of roots (one per MTREES entry) within DISTBASE
whenever DISTBASE is non-empty, such as base/base, base/base/var,
base/base/usr, etc. in the distributeworld case. This is purely cosmetic
though as they won't appear in the METALOG.
2023-06-08 19:14:12 +01:00
Enji Cooper c60be9ea6b Add simple factor/primes regression tests
This will help ensure that the change following this
one to support OpenSSL 3 is sane.

MFC after:	1 week
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D40297
2023-05-27 11:11:44 -07:00
Kyle Evans ccb59683b9 arm64: add tests for swp/swpb emulation
One test is suitable to be hooked up to the build, so I've done this
here.  The other test lives in tools/regression because failure is a
bit more subjective -- generally, one runs it for some unbounded amount
of time and observe if it eventually exits because two threads acquired
the same mutex.

Reviewed by:	imp, mmel
Sponsored by:   Stormshield
Sponsored by:   Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D39668
2023-05-15 10:42:16 -05:00
Dag-Erling Smørgrav 09aee57098 tsort: Add unit tests.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D40043
2023-05-10 15:45:44 +02:00
Yuri Pankov 7adea6dbed calendar: cleanup obsolete directories
Follow 5282ada06b and don't reinstall obsolete directories.
2023-05-09 00:43:12 +02:00
Emmanuel Vadot d198b8774d fwget: Introduce new utility
This script's goal is to check the system for peripherals that needs
firmware and install the needed packages for them.
For now it only support pci subsystem and only video classes for AMD
and Intel GPUs.

Reviewed by:	bapt
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D39825
2023-05-01 08:32:59 +02:00
Yuri Pankov f70719fcbd libcasper: remove leftover debug directory
Reviewed by:	mjg
Differential Revision:	https://reviews.freebsd.org/D39756
2023-04-23 09:50:50 +02:00
John Baldwin 7d8e1e8dd9 libcasper: Move helper libraries from /lib/casper to /lib.
These libraries are linked to directly by applications rather than
opened at runtime via dlopen().

Discussed with:	oshogbo
Reviewed by:	markj, emaste
Differential Revision:	https://reviews.freebsd.org/D39245
2023-03-29 15:04:28 -07:00
Ruslan Bukin 27c8d4851c Include Embedded Trace Extensions (ETE) source code to the OpenCSD build.
Sponsored by:	UKRI
2023-03-27 17:10:26 +01:00
Ed Maste d0f1f38202 Reserve u2f group for FIDO/U2F key support (SSH, etc.)
We have FIDO/U2F support in the base system now, so reserve a group ID
for it (maching the security/u2f-devd port).

Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34341
2023-03-14 13:09:40 -04:00
Dag-Erling Smørgrav 64c2a712d6 tftp: Add tests.
Sponsored by:	Klara, Inc.
Reviewed by:	asomers
Differential Revision:	https://reviews.freebsd.org/D38969
2023-03-10 13:25:16 +00:00
Brooks Davis af0cc0b223 NgATM: Remove netgraph ATM support
Most ATM support was removed prior to FreeBSD 12.  The netgraph support
was kept as it was less intrusive, but it is presumed to be unused.

Reviewed by:	manu
Relnotes:	yes
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D38879
2023-03-09 18:04:02 +00:00
Tijl Coosemans ecad3f5c4d rc.d: Generate machine-id from hostid_save
rc.d/hostid_save saves a UUID generated by rc.d/hostid in /etc/hostid.
Store the same UUID, without hyphens, in /etc/machine-id.  The hypĥens
are removed with a shell function because hostid_save runs before file
systems are mounted so other tools may not be available yet.

This eliminates some duplication between hostid and machine-id and for
virtual machines machine-id now contains the UUID configured in the
hypervisor like it does on Linux.

Reviewed by:	delphij
Discussed with:	bapt
MFC after:	3 days
Differential Revision:	https://reviews.freebsd.org/D38811
2023-03-09 10:31:55 +01:00
Mark Johnston 577b62c2ba pkgbase: Put termcap.small in the same package as termcap
Reviewed by:	manu
Differential Revision:	https://reviews.freebsd.org/D36951
2023-03-03 12:01:22 -05:00
Kyle Evans 0c42886449 sysctl: tests: fix a couple issues
The function that sets test case metadata is actually named ${tc}_head
rather than ${tc}, so add the suffix.

While we're here, hook the tests up to the infrastructure so that they
do get run.

Sponsored by:	Klara, Inc.
2023-03-01 14:38:46 -06:00
Dag-Erling Smørgrav dad64f0e7c wc: Clean up and modernize.
* Drop <err.h>, which is unnecessary since we use libxo.

* As per POSIX, report an error if output fails.

* Fix some type mismatches.

* Use bool instead of int where appropriate.

* Avoid repeatedly checking for a null filename.

* Miscellaneous other tidying.

* Add tests (partly derived from work performed by SHENG-YI HONG <i19780219111@kimo.com>).

Sponsored by:	Klara, Inc.
Reviewed by:	kevans
Differential Revision:	https://reviews.freebsd.org/D38496
2023-02-14 22:26:47 +00:00
Dimitry Andric 50d7464c3f Merge llvm-project release/15.x llvmorg-15.0.7-0-g8dfdcc7b7bf6
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.7-0-g8dfdcc7b7bf6.

PR:		265425
MFC after:	2 weeks
2023-02-08 20:05:25 +01:00
Dimitry Andric f3fd488f1e Merge llvm-project release/15.x llvmorg-15.0.6-0-g088f33605d8a
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.6-0-g088f33605d8a.

PR:		265425
MFC after:	2 weeks
2023-02-08 20:05:19 +01:00
Dimitry Andric 6246ae0b85 Merge llvm-project release/15.x llvmorg-15.0.2-10-gf3c5289e7846
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15.0.2-10-gf3c5289e7846.

PR:		265425
MFC after:	2 weeks
2023-02-08 20:05:09 +01:00
Dimitry Andric fcaf7f8644 Merge llvm-project main llvmorg-15-init-17485-ga3e38b4a206b
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-17485-ga3e38b4a206b.

PR:		265425
MFC after:	2 weeks
2023-02-08 20:04:38 +01:00
Dimitry Andric 753f127f3a Merge llvm-project main llvmorg-15-init-16436-g18a6ab5b8d1f
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-16436-g18a6ab5b8d1f.

PR:		265425
MFC after:	2 weeks
2023-02-08 20:03:59 +01:00
Dimitry Andric 81ad626541 Merge llvm-project main llvmorg-15-init-15358-g53dc0f10787
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-15-init-15358-g53dc0f10787.

PR:		265425
MFC after:	2 weeks
2023-02-08 20:02:26 +01:00
Mateusz Piotrowski e7ab133648 timeout: Move from /usr/bin to /bin
timeout(1) is used by /etc/rc.d/zfskeys. Unfortunately, having
timeout(1) installed in /usr/bin causes problems when /usr is an
encrypted ZFS partition.

Implementing timeout(1) in sh(1) is not trivial. A more elegant solution
is to move timeout(1) to /bin so that it is available to early services
in the boot process.

PR:		265221
Reviewed by:	allanjude, des, imp
Approved by:	allanjude, des, imp
Reported by:	Ivan <r4@sovserv.ru>
Fixes:	33ff39796f Add zfskeys rc.d script for auto-loading encryption keys
MFC after:	1 week
Relnotes:	yes
Sponsored by:	Modirum MDPay
Sponsored by:	Klara Inc.
Differential Revision:	https://reviews.freebsd.org/D38344
2023-02-02 18:34:35 +01:00
Dag-Erling Smørgrav 69d94f4c76 Add tarfs, a filesystem backed by tarballs.
Sponsored by:	Juniper Networks, Inc.
Sponsored by:	Klara, Inc.
Reviewed by:	pauamma, imp
Differential Revision:	https://reviews.freebsd.org/D37753
2023-02-02 18:19:29 +01:00
Gregory Neil Shapiro 431d2a81d4 Minor changes to force commit these files so new freebsd*.cf files are
built to use the new sendmail-8.17.1/cf tree.
2023-01-17 06:49:49 +00:00
Gregory Neil Shapiro 021562c502 Sync with vendor sendmail 8.17.1 cf/cf/submit.mc 2023-01-17 06:49:07 +00:00
Gleb Smirnoff c3ca3fa7d3 tests: add test for ipfw fwd localaddr,port
Checks basic forward to local address, also with presence of
a listener that matches original port (see aab8c844b9). Based
on non-ATF test case written by Pavel Polyakov.

Reviewed by:		kp, melifaro
Differential revision:	https://reviews.freebsd.org/D37960
2023-01-06 12:17:42 -08:00
Alexander V. Chernikov 8161b823d7 testing: add python test examples
Simplify the adoption of python tests by proving some examples,
 utilising commonly-used patterns.

Differential Revision: https://reviews.freebsd.org/D37902
Reviewed by:	asomers
MFC after:	2 weeks
2023-01-01 15:29:29 +00:00
John Baldwin 7a8d62cd04 termcap.small: Don't use -o pipefail.
The command to generate termcap.small doesn't use any pipes, so this
option is not needed.  Using it also breaks cross-building on hosts
where /bin/sh does not support pipefail such as Linux hosts where
/bin/sh is dash.

Reviewed by:	sobomax, imp
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D37865
2022-12-27 10:05:10 -08:00
Tobias C. Berner 62a149bf62 Add new rc: machine_id to generate /etc/machine-id
This new default-enabled rc will generate a /etc/machine-id file if it
does not exist, and pre-fill it with a newly generated UUID of version 4
[2].

The file is generated in /var/db/machine-id and symlinked to
/etc/machine-id to allow for read-only root partitions.

This file is amongst other things used by libraries like GLib.

Bump FreeBSD version 1400076 to be able to easily add support for older
version of FreeBSD via a package.

[1] Linux machine-id(5): https://www.man7.org/linux/man-pages/man5/machine-id.5.html
[2] f176fe8e7f

Approved by:		bapt
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D37722
2022-12-23 17:33:19 +01:00
Alexander V. Chernikov 80f03e63d6 netlink: improve interface handling
* Separate interface creation from interface modification code
* Support setting some interface attributes (ifdescr, mtu, up/down, promisc)
* Improve interaction with the cloners requiring to parse/write custom
 interface attributes
* Add bitmask-based way of checking if the attribute is present in the
message
* Don't use multipart RTM_GETLINK replies when searching for the
specific interface names
* Use ENODEV instead of ENOENT in case of failed RTM_GETLINK search
* Add python netlink test helpers
* Add some netlink interface tests

Differential Revision: https://reviews.freebsd.org/D37668
2022-12-14 19:52:35 +00:00
Baptiste Daroussin e1184adecf sendmail: remove leftovers from mta_start_script and rc.sendmail
Switch /etc/mail/Makefile to use /etc/rc.d/sendmail instead of
/etc/rc.sendmail this switch should have been done 20 years ago.

While here update the documentation to not refer anymore to
mta_start_script

Reported by:	Jose Luis Duran <jlduran@gmail.com>
2022-11-15 09:10:53 +01:00
Kyle Evans ac6f924e1c mktemp: add -p/--tmpdir argument
This matches other mktemp implementations, including OpenBSD and GNU.
The -p option can be used to provide a tmpdir prefix for specified
templates.  Precedence works out like so:

-t flag:
- $TMPDIR
- -p directory
- /tmp

Implied -t flag (no arguments or only -d flag):
- -p directory
- $TMPDIR
- /tmp

Some tests have been added for mktemp(1) in the process.

Reviewed by:	imp (earlier version), wosch
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D37121
2022-10-30 22:55:46 -05:00
John Baldwin 744bfb2131 Import the WireGuard driver from zx2c4.com.
This commit brings back the driver from FreeBSD commit
f187d6dfbf plus subsequent fixes from
upstream.

Relative to upstream this commit includes a few other small fixes such
as additional INET and INET6 #ifdef's, #include cleanups, and updates
for recent API changes in main.

Reviewed by:	pauamma, gbe, kevans, emaste
Obtained from:	git@git.zx2c4.com:wireguard-freebsd @ 3cc22b2
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D36909
2022-10-28 13:36:12 -07:00
Kyle Evans 75c3ca1ebf split: add some tests
This should cover all of the basic functionality, as well as the recent
enhancement to use a dynamic buffer size rather than limiting patterns
and lines to MAXBSIZE.

Reviewed by:	bapt
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D36324
2022-10-25 10:05:24 -05:00
Mark Johnston 19a847e5f2 kinst: Add a rudimentary regression test case
The test instruments a number of large, frequently called kernel
functions while generating load in the background.

MFC after:	3 months
2022-10-11 18:19:55 -04:00
Dag-Erling Smørgrav 0aa2700123 Put OPIE to rest.
Differential Revision: https://reviews.freebsd.org/D36592
2022-10-02 03:37:29 +02:00
Dag-Erling Smørgrav 497cdf9673 sh: read more profile files.
Differential Revision: https://reviews.freebsd.org/D36505
MFC after:	1 month
2022-10-01 21:30:56 +00:00
Alexander V. Chernikov 7e5bf68495 netlink: add netlink support
Netlinks is a communication protocol currently used in Linux kernel to modify,
 read and subscribe for nearly all networking state. Interfaces, addresses, routes,
 firewall, fibs, vnets, etc are controlled via netlink.
It is async, TLV-based protocol, providing 1-1 and 1-many communications.

The current implementation supports the subset of NETLINK_ROUTE
family. To be more specific, the following is supported:
* Dumps:
 - routes
 - nexthops / nexthop groups
 - interfaces
 - interface addresses
 - neighbors (arp/ndp)
* Notifications:
 - interface arrival/departure
 - interface address arrival/departure
 - route addition/deletion
* Modifications:
 - adding/deleting routes
 - adding/deleting nexthops/nexthops groups
 - adding/deleting neghbors
 - adding/deleting interfaces (basic support only)
* Rtsock interaction
 - route events are bridged both ways

The implementation also supports the NETLINK_GENERIC family framework.

Implementation notes:
Netlink is implemented via loadable/unloadable kernel module,
 not touching many kernel parts.
Each netlink socket uses dedicated taskqueue to support async operations
 that can sleep, such as interface creation. All message processing is
 performed within these taskqueues.

Compatibility:
Most of the Netlink data models specified above maps to FreeBSD concepts
 nicely. Unmodified ip(8) binary correctly works with
interfaces, addresses, routes, nexthops and nexthop groups. Some
software such as net/bird require header-only modifications to compile
and work with FreeBSD netlink.

Reviewed by:	imp
Differential Revision: https://reviews.freebsd.org/D36002
MFC after:	2 months
2022-10-01 14:15:35 +00:00
Ed Maste b4d15fdd53 Remove obsolete SystemV dir from BSD.usr.dist
/usr/share/zoneinfo/SystemV is removed via ObsoleteFiles as of commits
da038df8c9 and 57338837ae, so do not create it in the first place.

PR:		266666
Fixes:		da038df8c9 ("share/zoneinfo: don't build obsolete...")
MFC after:	3 days
2022-09-29 12:01:34 -04:00
Maxim Sobolev 3078531de1 Fix mergemaster(8) breakage in the 6ad780caa.
Split out termcap.small generation into its own Makefile under
etc/termcap, so it's properly executed by the underlying command:

  make 'SUBDIR_OVERRIDE=etc' everything

Reported by:	gbe
MFC after:	1 month
2022-09-13 13:36:22 -07:00
Cy Schubert 27b9777c28 libexec/rc: Add var_run rc script
Users with a tmpfs /var/run will lose the directory tree state of
/var/run at reboot. This rc script will optionally (by default)
capture the state of the directory structure in /var/run prior to
shutdown and recreate it at system boot.

Alternatively a user can save the state of the /var/run directories
manually using service var_run save and disable the autosaving of
/var/run state using the var_run_autosave variable, for those
paranoid SSD users.

PR:			259585, 259699
Reported by:		freebsd@walstatt-de.de,
Reviewed by:		philip, gbe (previous version)
MFC after:		1 week
Differential Revision:	https://reviews.freebsd.org/D36386
2022-09-05 06:19:42 -07:00
Dag-Erling Smørgrav 7ccdad905f renice: add unit tests.
Sponsored by:	Klara, Inc.
2022-08-25 20:06:20 +00:00
Emmanuel Vadot 1a104a3bf3 pkgbase: mtree: Correctly tag /var/db entries 2022-08-16 21:14:56 +02:00
Emmanuel Vadot d2888f5ccf pkgbase: mtree: Correctly tag /var/run entries 2022-08-16 21:14:49 +02:00
Alex Richardson ac175bd33a Install working pkgconfig .pc files for compat libraries
The default ones are install them to /usr/libdata/pkgconfig, and we can't
use this path for compat libraries, so we use /usr/lib<suffix>/pkgconfigi here.

Test Plan:	grep -rn libdir= ./usr/lib32/pkgconfig/*.pc
MFC after:	1 week
Differential Revision: https://reviews.freebsd.org/D34939
2022-08-11 23:18:34 +01:00
Mateusz Piotrowski e7437ae907 rc: Start testing the rc(8) framework (beginning with *_oomprotect)
This change adds 2 tests to make sure that the *_oomprotect variable
sets the protection against OOM killer properly within rc(8) scripts.

This is also adding the first tests for the rc(8) framework. More tests
will be added as we go.

PR:		256148
Approved by:	des
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D35745
2022-07-26 15:39:39 +02:00
Jessica Clarke 76c100d634 etc: Fix distrib-dirs to not rely on a BSDism
FreeBSD and macOS have a test that treats == as an alias for =, but
Linux tends to use GNU coreutils (when not a builtin) which does not.
Use the standard syntax instead for compatibility.

Obtained from:	CheriBSD
Differential Revision:	https://reviews.freebsd.org/D35811
2022-07-15 23:04:16 +01:00
Kristof Provost 067acae2f3 if_ovpn tests: basic test case
Set up an OpenVPN tunnel between two jails, send traffic through them to
confirm basic function.

Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D35067
2022-06-28 13:50:37 +02:00
Alexander V. Chernikov 924226fba1 testing: move atf-pytest-wrapper to /usr/libexec
Move pytest wrapper to the collection of the other atf wrappers
 in libexec. It solves the problem of combining bits & pieces from
 bsd.test.mk and bgs.prog.mk to address "test binary, but not the
 suite binary".

Reviewed by:	kp
Differential Revision: https://reviews.freebsd.org/D35604
MFC after:	2 weeks
2022-06-26 13:25:47 +00:00
Alexander V. Chernikov 9a75209d2b routing: add tests/sys/net/routing to mtree
MFC after:	2 weeks
2022-06-25 21:16:14 +00:00
Dimitry Andric 56f451bb3b Merge llvm-project release/14.x llvmorg-14.0.5-0-gc12386ae247c
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14.0.5-0-gc12386ae247c, aka 14.0.5 release.

PR:		261742
MFC after:	3 days
2022-06-12 20:53:16 +02:00
Dimitry Andric 987d26ee3f Remove yet another incorrect .. level from BSD.usr.dist
Since the spacing was off, it was not clear that it descended one level
too many.

Fixes:		695052e240
MFC after:	3 days
2022-06-12 16:46:17 +02:00
Xin LI 695052e240 Fix mtree for usr/
MFC after:	3 days
2022-06-11 21:38:05 -07:00
Dimitry Andric 809922b010 Update rest of llvm-project build glue for 14.0.4
I completely forgot about updating the generated llvm-project config
files, which also contain version numbers, etc. Sorry for the churn.

PR:		261742
Fixes:		ab9d54731f
MFC after:	3 days
2022-06-05 18:39:43 +02:00
Dimitry Andric 7b6f5ebef6 Add several sanitizer ignore lists under /usr/lib/clang
Some of the sanitizers from compiler-rt can use ignore lists, which are
loosely modeled on valgrind's example. Upstream provides default lists
for AddressSanitizer, CFI, and MemorySanitizer, so install these in the
expected location, /usr/lib/clang/14.0.3/share.

Reviewed by:	emaste
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D35338
2022-05-28 15:46:38 +02:00
Dimitry Andric 3a9a9c0ca4 Merge llvm-project release/14.x llvmorg-14.0.3-0-g1f9140064dfb
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14.0.3-0-g1f9140064dfb.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:46:42 +02:00
Dimitry Andric 04eeddc0aa Merge llvm-project main llvmorg-14-init-17616-g024a1fab5c35
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-17616-g024a1fab5c35.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:44:34 +02:00
Dimitry Andric 4824e7fd18 Merge llvm-project main llvmorg-14-init-11187-g222442ec2d71
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-11187-g222442ec2d71.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:43:49 +02:00
Dimitry Andric 5e801ac66d Merge llvm-project main llvmorg-14-init-10223-g401b76fdf2b3
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-14-init-10223-g401b76fdf2b3.

PR:		261742
MFC after:	2 weeks
2022-05-14 13:43:32 +02:00
Piotr Pawel Stefaniak 47bcbde91d bintrans: move files to a new directory
And reflect the change in various places.
2022-04-18 10:53:11 +02:00
Piotr Pawel Stefaniak 4cd4841a27 Modularize uuencode and uudecode by wrapping them in bintrans.c
The program will be installed as bintrans, uuencode, uudecode,
b64encode, and b64decode and will be responsible for running the coders
according to their historical behavior.

Additionally, bintrans will be able to take a parameter designating
the coder and accept all its options in this form:
bintrans <coder> [options]
and the behavior should be the same as if
<coder> [options]
was invoked.
This has the advantage that adding coders won't require installing them
as binaries.

Move uudecode files to uuencode since the latter is the one that
provides the manual page.

Reviewed by:	delphij (previous version)
Differential Revision:	https://reviews.freebsd.org/D32943
2022-04-18 10:46:44 +02:00
Mark Johnston 10aa36702c etc/mtree: Remove tabs 2022-04-15 10:27:22 -04:00
Mark Johnston d0f245d21f libsysdecode: Add regression tests for sysdecode_cap_rights(3)
Reviewed by:	jhb, emaste
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D34900
2022-04-15 10:23:32 -04:00
Kirk McKusick c7996ddf80 Create a new GEOM utility, gunion(8).
The gunion(8) utility is used to track changes to a read-only disk on
a writable disk. Logically, a writable disk is placed over a read-only
disk. Write requests are intercepted and stored on the writable
disk. Read requests are first checked to see if they have been
written on the top (writable disk) and if found are returned. If
they have not been written on the top disk, then they are read from
the lower disk.

The gunion(8) utility can be especially useful if you have a large
disk with a corrupted filesystem that you are unsure of how to
repair. You can use gunion(8) to place another disk over the corrupted
disk and then attempt to repair the filesystem. If the repair fails,
you can revert all the changes in the upper disk and be back to the
unchanged state of the lower disk thus allowing you to try another
approach to repairing it. If the repair is successful you can commit
all the writes recorded on the top disk to the lower disk.

Another use of the gunion(8) utility is to try out upgrades to your
system. Place the upper disk over the disk holding your filesystem
that is to be upgraded and then run the upgrade on it. If it works,
commit it; if it fails, revert the upgrade.

Further details can be found in the gunion(8) manual page.

Reviewed by: Chuck Silvers, kib (earlier version)
tested by:   Peter Holm
Differential Revision: https://reviews.freebsd.org/D32697
2022-02-28 16:36:08 -08:00
Eric van Gyzen 1581ec9a45 Integrate contrib/file/tests with kyua/atf
This could be done better by making each test a separate ATF test case.
This exercise is left for the reader.

Reviewed by:	delphij (earlier version)
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34303
2022-02-16 13:02:45 -06:00
Eric van Gyzen 4e71258227 newfs_msdos: connect the ATF test from NetBSD
NetBSD has an ATF test for newfs_msdos.  Connect it to the build.
Adapt it for FreeBSD.  This would have caught the bug fixed by my
previous commit.

Reviewed by:	delphij, emaste
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D34116
2022-02-16 09:56:16 -06:00
Michael Reifenberger 19eaa01bea Append Keyboard Layout specified option for using VNC.
Part two: Append bhyve -K option for specified keyboard layout
with layout setting files every languages.
Since the cmd option '-k' was used in the meantime
it was changed to '-K'

PR:		246121
Submitted by:	koinec@yahoo.co.jp
Reviewed by:	grehan@
Differential Revision:	https://reviews.freebsd.org/D29473

MFC after:	4 weeks
2022-01-20 23:49:27 +01:00
Warner Losh 72bf91e250 libsoft: Remove support for installing libsoft
Remove the infrasturcture needed to create the libsoft directories.

Sponsored by:		Netflix
2022-01-06 22:34:10 -07:00
Emmanuel Vadot dcf9d46a3f pkgbase: Create a FreeBSD-mtree package
And put the mtree binary and files in it.
Useful to create small mfsroot using /etc/rc.d/var without
having to install FreeBSD-utilities.

MFC after:	2 weeks
Sponsored by:	Beckhoff Automation GmbH & Co. KG
Differential Revision:	https://reviews.freebsd.org/D33442
2021-12-21 10:17:33 +01:00
Florian Walpen a9545eede4 Add idle priority scheduling privilege group to MAC/priority
Add an idletime user group that allows non-root users to run processes
with idle scheduling priority. Privileges are granted by a MAC policy in
the mac_priority module. For this purpose, the kernel privilege
PRIV_SCHED_IDPRIO was added to sys/priv.h (kernel module ABI change).

Deprecate the system wide sysctl(8) knob
security.bsd.unprivileged_idprio which lets any user run idle priority
processes, regardless of context. While the knob is still working, it is
marked as deprecated in the description and in the man pages.

MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D33338
2021-12-10 04:54:48 +02:00
Florian Walpen bf2fa8d9d1 MAC/priority module for realtime privilege group
This is a MAC policy module that grants scheduling privileges based on
group membership.  Users or processes in the group realtime (gid 47) are
allowed to run threads and processes with realtime scheduling priority.
For timing-sensitive, low-latency software like audio/jack, running with
realtime priority helps to avoid stutter and gaps.

PR:	239125
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D33191
2021-12-04 20:19:25 +02:00
Baptiste Daroussin 37d0601f42 bsddialog: import new TUI widget and utility
bsddialog is an attempt to write in permissive license a replacement for
libdialog.

While it is still in early stage it is good enough to already be used in
many areas, it is imported as private lib until it matures enough to be
considered as having a stable ABI
2021-11-24 11:03:31 +01:00
Dimitry Andric 6e75b2fbf9 Merge llvm-project release/13.x llvmorg-13.0.0-rc1-97-g23ba3732246a
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13.0.0-rc1-97-g23ba3732246a.

PR:		258209
MFC after:	2 weeks
2021-11-13 21:42:03 +01:00
Dimitry Andric fe6060f10f Merge llvm-project main llvmorg-13-init-16847-g88e66fa60ae5
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-13-init-16847-g88e66fa60ae5, the last commit before
the upstream release/13.x branch was created.

PR:		258209
MFC after:	2 weeks
2021-11-13 21:39:49 +01:00
Warner Losh 517e52b6c2 awk: Move to using two sets of tests
Upstream one-true-awk has two sets of tests. These are in addition to
NetBSD's tests we're using. The 'bugs-fixed' tests from upstream are
ready to use as-is (more or less). However, the 'tests' from upstream
are not, so for now we'll just use the netbsd and bugs-fixed tests.
They provide an OK workout and are better than nothing, though the tests
themselves are for specific esoteric things.

The upstream bugs-fixed tests are *ALMOST* a drop in. However, 3 test
for errors and the upstream test jig mashes stdout and stderr together,
which atf doesn't do, so make a tiny tweak to the upstream tests that I
hope to upstream. Plus upstream has ../a.out: instead of awk: in the
output. Not sure how to deal with this yet, so I've not proposed
anything upstream and have changed the test locally.

In addition, the system-status.awk test is not suitable to run in ATF.
It wants to force sh to dump core, but kyua doesn't seem to allow that
sometimes so the test will fail or pass based on whether or not a core
dump can be created. Since it's unstable, remove it.

This required moving the netbsd tests to a new direcotry, so update
mtree files as well. The change is useless for 'make check' without it.

Sponsored by:		Netflix
Differential Revision:	https://reviews.freebsd.org/D31376
2021-11-05 08:53:36 -06:00
Baptiste Daroussin d410b585b6 sh(1): make it the default shell for the root user
In the recent history sh(1) has gain the missing features for it to
become a usable interractive shell:
- command completion
- persistent history support
- improvements on the default bindings in emacs mode
- improvements in the vi mode (repect $EDITOR)
- print a newline when exiting via ^D
- default prompt and improvements on how PS1 can be configured
- and more.

This changes also simplifies making tiny freebsd images with only sh(1)
as a shell
2021-10-20 09:34:05 +02:00
Antranig Vartanian 7955efd574 Add support for jail.conf.d
Using /etc/jail.{jailname}.conf is nice, however it makes /etc/ very
messy if you have many jails.  This patch allows one to move these
config files out of the way into /etc/jail.conf.d/{jailname}.conf.

Note that the same caveat as /etc/jail.*.conf applies: the jail service
will not autodiscover all of these for starting 'all' jails.  This is
considered future work, since the behavior matches.

Reviewed by:	kevans
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D24570
2021-09-10 00:30:04 -05:00
Piotr Pawel Stefaniak f8e50dd2c6 Register /usr/tests/usr.bin/diff3
I wasn't able to make check to run diff3 tests, but kevans figured out
that I was missing diff3 in mtree.
2021-08-23 07:04:28 +02:00
Cyril Zhang a85404906b vmm: Add credential to cdev object
Add a credential to the cdev object in sysctl_vmm_create(), then check
that we have the correct credentials in sysctl_vmm_destroy(). This
prevents a process in one jail from opening or destroying the /dev/vmm
file corresponding to a VM in a sibling jail.

Add regression tests.

Reviewed by:	jhb, markj
MFC after:	2 weeks
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D31156
2021-08-18 13:41:33 -04:00
Baptiste Daroussin c982a41a0c mtree: remove a leftover '..' in BSD.usr.dist making it inconsistent
Reported by:	Michael Butler <imb@protected-networks.net>
2021-08-03 17:06:31 +02:00
Baptiste Daroussin 184d64af13 locales: stop hardcoding the directories in the mtree
The framework knows how to create directories and tag them properly
for a the creation of a mtree, not need to hardcode all the locales
entries in bsd.usr.mk

This simplifies addition of new locales but also allow people building
with WITHOUT_LOCALES to end up with a directory full of empty files
2021-08-03 14:25:00 +02:00
Martin Matuska 48b4fe0503 zfs: attach zpool_influxdb to build
From the zpool_influxdb.8 manual page:
  zpool_influxdb produces InfluxDB-line-protocol-compatible metrics from
  zpools.  Like the zpool command, zpool_influxdb reads the current pool
  status and statistics.  Unlike the zpool command which is intended for
  humans, zpool_influxdb formats the output in the InfluxDB line protocol.
  The expected use is as a plugin to a metrics collector or aggregator,
  such as Telegraf.

zpool_influxdb is installed into /usr/libexec/zfs/

Differential revision:	https://reviews.freebsd.org/D31094
MFC after:	3 days
2021-07-07 20:15:12 +02:00
Li-Wen Hsu cb194afef5
sbin/md5: Create /usr/tests/sbin/md5 directory for placing tests
Sponsored by:	The FreeBSD Foundation
2021-06-25 18:29:46 +08:00
Dimitry Andric 23408297fb Merge llvm-project 12.0.1 rc2
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.1-rc2-0-ge7dac564cd0e, a.k.a. 12.0.1 rc2.

PR:		255570
MFC after:	6 weeks
2021-06-19 20:09:28 +02:00
Emmanuel Vadot ed0a582d88 pkgbase: Put the last sendmail files in the sendmail package
Differential Revision:	https://reviews.freebsd.org/D30757
Sponsored by:	Diablotin Systems
2021-06-19 17:50:11 +02:00
Ceri Davies 64e6e1e463 secure/caroot, certctl: Rename secure/caroot/blacklisted
Old certctl commands still work for compatability, but are deprecated.

Approved by:	secteam (gordon)
Differential Revision: https://reviews.freebsd.org/D30807
2021-06-18 13:38:07 +01:00
Dimitry Andric d409305fa3 Merge llvm-project 12.0.0 release
This updates llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and
openmp to llvmorg-12.0.0-0-gd28af7c654d8, a.k.a. 12.0.0 release.

PR:		255570
MFC after:	6 weeks
2021-06-13 22:01:15 +02:00