Commit graph

513 commits

Author SHA1 Message Date
Baptiste Daroussin 8aac90f18a mac_do: add a new MAC/do policy and mdo(1) utility
This policy enables a user to become another user without having to be
root (hence no setuid binary). it is configured via rules using sysctl
security.mac.do.rules

For example:
security.mac.do.rules=uid=1001:80,gid=0:any

The above rule means the user identifier by the uid 1001 is able to
become user 80
Any user of the group 0 are allowed to become any user on the system.

The mdo(1) utility expects the MAC/do policy to be installed and its
rules defined.

Reviewed by:	des
Differential Revision:	https://reviews.freebsd.org/D45145
2024-05-22 14:01:41 +02:00
Dag-Erling Smørgrav 125c4560bc usr.bin: Make lorder conditional on MK_TOOLCHAIN.
MFC after:	1 week
Reviewed by:	allanjude, markj
Differential Revision:	https://reviews.freebsd.org/D44558
2024-04-01 15:18:35 +02:00
Rick Parrish 0112f8c4a8 posixmqcontrol(1): manage posix message queues
Reviewed by:	kib, paumma
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D43845
2024-02-24 01:08:48 +02:00
Warner Losh bdcbfde31e usr.bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2023-11-26 22:23:30 -07:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06: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
Baptiste Daroussin cb1fc924d2 genl: add new command to list genetlink(4)
This commands list genetlink protocols and its operations and
capabilities

Name: nlctrl
	ID: 0x10, Version: 00, header size: 2, max attributes: 10
	supported operations:
	 - ID: 0x3, Capabilities: 0xe (can modify; can get/dump;
has policy)
	multicast groups:
	 - ID: 0x30, Name: notify
Name: carp
	ID: 0x11, Version: 00, header size: 2, max attributes: 2
	supported operations:
	 - ID: 0x1, Capabilities: 0xe (can modify; can get/dump;
has policy)
	 - ID: 0x2, Capabilities: 0xb (requires admin permission;
can modify; has policy)

Reviewed by:		melifaro
Differential Revision:	https://reviews.freebsd.org/D40330
2023-05-30 13:36:43 +02:00
Cameron Katri 81fa5c4a82 llvm-strings: Install as strings when WITH_LLVM_BINUTILS=YES
Reviewed by:	emaste
Differential Revision:	https://reviews.freebsd.org/D32065
2023-04-21 16:13:40 -04: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
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
Ed Maste ac4c695ad6 Retire WITHOUT_CXX option
Several important base system components are written in C++, and the
WITHOUT_CXX option produced a system that was not fully functional.
Just accept this, and remove the option to build without C++ support.

This reverts commit adc3c128c6.

Reviewed by:	brooks, kevans, jhb (earlier)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D33108
2023-01-26 21:13:16 -05:00
John Baldwin 42d10b1b56 rs: Convert to C++ to convert elem to a std::vector<char *>.
This also updates various indices and counters from int to size_t to
pacify resulting -Wsign-compare warnings.

Reviewed by:	brooks
Differential Revision:	https://reviews.freebsd.org/D36833
2022-11-15 21:03:12 -08:00
Kyle Evans 0283826706 usr.bin: hook wg(8) up to the build
wg(8) is used to manage WireGuard interfaces; see wg(4) and wg(8) both
for more details and usage examples.
2022-10-28 22:05:39 -05: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
Xin LI 278d080bad Remove minigzip from the base system.
The minigzip(1) was initially introduced as a minimal replacement
of GNU gzip(1). We have replaced the GNU gzip(1) with the zlib
based, GPL-free implementation, and minigzip(1) is not being used
anywhere in the base system, so just remove it.

Relnotes:	yes
Reviewed by:	emaste
Differential Revision: https://reviews.freebsd.org/D35979
2022-08-13 21:11:50 -07: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
Alfonso S. Siciliano e031614d59
bsddialog: new utility for TUI dialogs and widgets
Approved by:		bapt (mentor)
Differential Revision:	https://reviews.freebsd.org/D34101
2022-03-06 22:50:20 +01:00
Hans Petter Selasky 8abfbe5a79 beep(1): Initial version of utility to create terminal beep via soundcard.
Reviewed by:	imp@, emaste@ and pstef@
Differential Revision:	https://reviews.freebsd.org/D32672
MFC after:	1 week
Sponsored by:	NVIDIA Networking
2021-11-04 09:00:46 +01:00
Alex Richardson 021385aba5 Add WITH_LLVM_BINUTILS to install LLVM binutils instead of Elftoolchain
When WITH_LLVM_BINUTILS is set, we will install the LLVM binutils as
ar/ranlib/nm/objcopy/etc. instead of the elftoolchain ones.
Having the LLVM binutils instead of the elftoolchain ones allows us to use
features such as LTO that depend on binutils that understand LLVM IR.
Another benefit will be an improved user-experience when compiling with
AddressSanitizer, since ASAN does not symbolize backtraces correctly if
addr2line is elftoolchain addr2line instead of llvm-symbolizer.
See https://lists.freebsd.org/archives/freebsd-toolchain/2021-July/000062.html
for more details.

This is currently off by default but will be turned on by default at some
point in the near future.

Reviewed By:	emaste

Differential Revision: https://reviews.freebsd.org/D31060
2021-09-06 09:49:49 +01:00
Alex Richardson 2de949cf85 Remove mkcsmapper_static and mkesdb_static from build-tools
Build them as part of the bootstrap-tools phase instead.

Reviewed by:	emaste (no objections)
Differential Revision: https://reviews.freebsd.org/D28181
2021-08-02 14:33:25 +01:00
Alex Richardson 89da04fcaa Revert "Remove lib/kyua from the build"
Accidentally removed it from the wrong file...

This reverts commit 8ec4ba8a76.
2021-07-02 10:17:03 +01:00
Alex Richardson 8ec4ba8a76 Remove lib/kyua from the build
I forgot to include this line in 2eb9ad4274.

Reported by:	Jenkins CI
MFC after:	1 week
Fixes:		2eb9ad427475190ei ("Simplify and speed up the kyua build")
2021-07-02 09:56:05 +01:00
John Baldwin 0333fad1b7 Remove svnlite.
Reviewed by:	bcr, imp, emaste
Differential Revision:	https://reviews.freebsd.org/D30737
2021-06-11 14:56:41 -07:00
Baptiste Daroussin 61f66a1f44 ncurses: Add support for terminfo database
Along with the termcap database, ncurses will now lookup for the
terminfo database, note that the terminfo database is being looked
up first and then it fallsback on the termcap one.

While here drop our custom reader for the termcap database, over the
time it is needed maintenance to be able to catchup with changes on ncurses
side.

Install the ncurses tools which are needed to deal with the terminfo
database: tic, infocmp, toe

Replace our termcap only aware tools with the ncurses counterpart:
tput, tabs, tset, clear and reset

In particular they can your the extra capabilities described in the
terminfo database, which does not exist in termcap

Note that to add a new terminfo information to the database from ports
the ports will just need to add their extra information into:
/usr/local/share/site-terminfo/<firstletteroftheterm>/<term>

Tested by:	jbeich, manu
2021-02-25 14:25:11 +01:00
Emmanuel Vadot 8af54bdfca lastcomm(1): Only install if MK_ACCT is on
MFC after:	3 days
2021-02-06 20:41:39 +01:00
Alex Richardson c1a3d7f206 Remove remaining uses of ${COMPILER_FEATURES:Mc++11}
All supported compilers have C++11 support so these checks can be replaced
with MK_CXX guards.
See also https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=252759

PR:		252759
Reviewed By:	emaste
Differential Revision: https://reviews.freebsd.org/D28234
2021-01-19 21:37:36 +00:00
Dimitry Andric 07bab4417d Add WITH_LLVM_CXXFILT option to install llvm-cxxfilt as c++filt
Since elftoolchain's cxxfilt is rather far behind on features, and we
ran into several bugs, add an option to use llvm-cxxfilt as an drop-in
replacement.

It supports the same options as elftoolchain cxxfilt, though it doesn't
have support for old ARM (C++ Annotated Reference Manual, not the CPU)
and GNU v2 manglings. But these are irrelevant in 2020.

Note: as we already compile the required libraries as part of libllvm,
this will not add any significant build time either.

PR:		250702
Reviewed by:	emaste, yuri
Differential Revision: https://reviews.freebsd.org/D27071
MFC after:	2 weeks
2020-11-03 19:57:28 +00:00
Emmanuel Vadot 9ddaa99d9d Add backlight(8)
This tool is used to configure registered backlights.
It can incr/decr (default to 10%) or accept a percentage value directly.

Reviewed by:	manpages (gbe@)
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26251
2020-10-02 18:21:30 +00:00
Andrew Turner e7b841ae27 Cleanups for gprof:
* Remove identical or almost identical headers
 * Only build aout.c on amd64 and i386. None of the the other current
   architectures ever supported running a.out binaries
 * Enable on all architectures

Sponsored by:	Innovate UK
Differential Revision:	https://reviews.freebsd.org/D26369
2020-09-14 16:18:53 +00:00
Stefan Eßer 252884ae7e Import new 2-clause BSD licenced implementation of the bc and dc commands
These implementations of the bc and dc programs offer a number of advantages
compared to the current implementations in the FreeBSD base system:

- They do not depend on external large number functions (i.e. no dependency
  on OpenSSL or any other large number library)

- They implements all features found in GNU bc/dc (with the exception of
  the forking of sub-processes, which the author of this version considers
  as a security issue).

- They are significantly faster than the current code in base (more than
  2 orders of magnitude in some of my tests, e.g. for 12345^100000).

- They should be fully compatible with all features and the behavior of the
  current implementations in FreeBSD (not formally verified).

- They support POSIX message catalogs and come with localized messages in
  Chinese, Dutch, English, French, German, Japanese, Polish, Portugueze,
  and Russian.

- They offer very detailed man-pages that provide far more information than
  the current ones.

The upstream sources contain a large number of tests, which are not
imported with this commit. They could be integrated into our test
framework at a latter time.

Installation of this version is controlled by the option "MK_GH_BC=yes".
This option will be set to yes by default in 13-CURRENT, but will be off
by default in 12-STABLE.

Approved by:	imp
Obtained from:	https://git.yzena.com/gavin/bc
MFC after:	4 weeks
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D19982
2020-06-27 12:02:01 +00:00
Brooks Davis b0d29bc47d Import the kyua test framework.
Having kyua in the base system will simplify automated testing in CI and
eliminates bootstrapping issues on new platforms.

The build of kyua is controlled by WITH(OUT)_TESTS_SUPPORT.

Reviewed by:	emaste
Obtained from:	CheriBSD
Sponsored by:	DARPA
Differential Revision:	https://reviews.freebsd.org/D24103
2020-03-23 19:01:23 +00:00
Conrad Meyer fd1efedc79 Add extremely useful calendar(1) application to FreeBSD
It does extremely useful things like execute sendmail and spew dubiously
accurate factoids.

From the feedback, it seems like it is an essential utility in a modern unix
and not at all a useless bikeshed.  How do those Linux people live without it?
Reverts r358561.
2020-03-03 00:20:08 +00:00
Conrad Meyer 3c565de33f Fix typo in r278616
FreeBSD isn't an encyclopedia.
2020-03-02 23:37:47 +00:00
Ed Maste 79bfb05b07 Move ELF feature note tool to usr.bin/elfctl
elfctl is a tool for modifying the NT_FREEBSD_FEATURE_CTL ELF note,
which contains a set of flags for enabling or disabling vulnerability
mitigations and other features.

Reviewed by:	csjp, kib
MFC after:	2 weeks
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23910
2020-03-02 02:36:41 +00:00
Ed Maste 134b378392 retire in-tree GPL dtc devicetree compiler
Now that we no longer have GCC 4.2.1 in the tree and can assume FreeBSD
is being built with a C++11 compiler available, we can use BSDL dtc
unconditionally and retire the GPL dtc.

GPL dtc now has FreeBSD CI support via Cirrus-CI to help ensure it
continues to build/work on FreeBSD and is available in the ports tree
if needed.

The copy of (copyfree licensed) libfdt that we actually use is in
sys/contrib/libfdt so the extra copy under contrib/dtc/libfdt can be
removed along with the rest of the GPL dtc.

Reviewed by:	kevans, ian, imp, manu, theraven
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D23192
2020-02-29 17:10:54 +00:00
Warner Losh dd99ab06f3 Remove elf2aout
Remove the long obsolete elf2aout utility. Should any ports need to
know when this left the tree, use 1300077 as the revision so we
avoid multiple bumps for the sparc64 removal.

Reviewed by: brooks@, emaste@
Differential Revision: https://reviews.freebsd.org/D23527
2020-02-06 17:52:16 +00:00
Kristof Provost 467d94844e gprof: Enable riscv
Add a missing riscv.h header file, and fix the check for riscv (must test
MACHINE_CPUARCH, not MACHINE_ARCH, if we want to use 'riscv').

Sponsored by:	Axiado
2020-01-13 16:52:26 +00:00
Brooks Davis a4330302f2 libcompat: build 32-bit rtld and ldd as part of "everything"
Alter bsd.compat.mk to set MACHINE and MACHINE_ARCH when included
directly so MD paths in Makefiles work. In the process centralize
setting them in LIBCOMPATWMAKEENV.

Alter .PATH and CFLAGS settings in work when the Makefile is included.

While here only support LIB32 on supported platforms rather than always
enabling it and requiring users of MK_LIB32 to filter based
TARGET/MACHINE_ARCH.

The net effect of this change is to make Makefile.libcompat only build
compatability libraries.

Changes relative to r354449:

Correct detection of the compiler type when bsd.compat.mk is used
outside Makefile.libcompat.  Previously it always matched the clang
case.

Set LDFLAGS including the linker emulation for mips where -m32 seems to
be insufficent.

Reviewed by:	imp, kib (origional version in r354449)
Obtained from:	CheriBSD (conceptually)
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D22251
2019-11-07 22:58:10 +00:00
Brooks Davis ccad77fe1e Revert r354449: libcompat: build 32-bit rtld and ldd as part of "everything"
Additional testing is required..
2019-11-07 19:22:51 +00:00
Brooks Davis 36712a9497 libcompat: build 32-bit rtld and ldd as part of "everything"
Alter bsd.compat.mk to set MACHINE and MACHINE_ARCH when included
directly so MD paths in Makefiles work. In the process centralize
setting them in LIBCOMPATWMAKEENV.

Alter .PATH and CFLAGS settings in work when the Makefile is included.

While here only support LIB32 on supported platforms rather than always
enabling it and requiring users of MK_LIB32 to filter based
TARGET/MACHINE_ARCH.

The net effect of this change is to make Makefile.libcompat only build
compatability libraries.

Reviewed by:	imp, kib
Obtained from:	CheriBSD (conceptually)
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D22251
2019-11-07 17:10:33 +00:00
Baptiste Daroussin c844ab6717 Remove mklocale(1) and colldef(1) which are deprecated since FreeBSD 11
In FreeBSD 11 along with the rework on the collation, mklocale(1) and colldef(1)
has been replaced by localedef(1) (a note has been added to the manpage to state
it).
mklocale(1) and colldef(1) has been kept around to be able to build older
versions of FreeBSD. None of the version requiring those tools are supported
anymore so it is time to remove them from base
2019-09-10 07:54:49 +00:00
Konstantin Belousov 5f4592e46f Add posixshmcontrol(1), an utility to manipulate posix shared memory segments.
See usage for the command line structure.  Man page will come shortly.

Reviewed by:	jilles, tmunro
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential revision:	https://reviews.freebsd.org/D20258
2019-05-23 14:33:01 +00:00
Eugene Grosbein fcd7ccb28c Move trim(1) from usr.bin to usr.sbin to become trim(8).
Requested by:	se
MFC after:	1 month
2018-11-29 16:08:16 +00:00
Eugene Grosbein bf64d87e6c Add new small tool trim(1) to delete contents for blocks on flash
based storage devices that use wear-leveling algorithms.

Reviewed by:	hackers@
MFC after:	1 month
2018-11-29 14:21:26 +00:00
Eitan Adler 4750b59aca send-pr: wave goodbye
Entering into the world of 12.x we no longer need even the placeholder
for send-pr. It has not done anything for some time.

With Hat: bugmeister
2018-08-19 07:12:35 +00:00
Konstantin Belousov b3042426d0 Remove bits of the old NUMA.
Remove numactl(1), edit numa(4) to bring it some closer to reality,
provide libc ABI shims for old NUMA syscalls.

Noted and reviewed by:	brooks (previous version)
Sponsored by:	The FreeBSD Foundation
Differential revision:	https://reviews.freebsd.org/D16142
2018-07-10 22:00:20 +00:00
Eitan Adler aa571745a6 Makefiles: remove outdated comments 2018-06-24 09:39:40 +00:00
Ed Maste 9b844631a6 Rename usr.bin/elfcopy to usr.bin/objcopy
We always install ELF Tool Chain's elfcopy as objcopy, so to avoid
confusion rename the src directory containing our reach-over Makefile
to match.

Requested by:	jhb
Sponsored by:	The FreeBSD Foundation
2018-06-21 14:28:20 +00:00
Konstantin Belousov f39bffc62c Rework ofed build.
Aligns the build with the FreeBSD traditional approach to not build in
contrib/, and to track inter-dependencies between libraries.

With help from:	bdrewery
Reviewed by:	bdrewery, hselasky
Sponsored by:	Mellanox Technologies
MFC after:	2 weeks
Differential revision:	https://reviews.freebsd.org/D15648
2018-06-16 15:05:05 +00:00