freebsd-src/libexec
Simon J. Gerraty aa3b7a2fbc /etc/rc add trace debug and verify
Debugging boot issues can be helped by
logging each rc.d script as it is run
and being able to selectively enable/disable set -x
debug.sh provides an elaborate framework for debugging shell scripts.

For secure systems, we want to be paranoid about what we read
during boot.

dot()	simply reads (.) arg file if it exists
vdot()	if mac_veriexec is active, ignore unverified files
	otherwise behaves much the same as dot()
safe_dot()  in safe_eval.sh allows reading an untrusted file;
	limiting the input to simple variable assignments.

In load_rc_config allow caller to provide an option to indicate how to
handle its arg:
	-v use vdot()
	-s use sdot() which will try to use vdot() and fallback to safe_dot()
	The default is to read using dot()

rc_run_scripts()
	encapsulate the running of rc.d scripts
	so that we can easily call it more than twice.

We vdot local.rc.subr to pick up extensions (like
run_rc_scripts_final) and overrides.

We also allow rc.subr.local or rc.conf to set rc_config_xtra
eg (rc_config_xtra=XXX for historic compatibility)

rc use set -o verify around the reading in of rc.subr
This has no effect if mac_veriexec is not active, but if it is; ensures
rc.subr has not been tampered with.

Reviewed by:	imp
Sponsored by:	Juniper Networks, Inc.
Differential Revision:	https://reviews.freebsd.org/D43671
2024-02-09 09:15:58 -08:00
..
atf Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
atrun Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
blacklistd-helper Track upstream project rename in contrib/blocklistd 2023-11-03 16:53:04 -04:00
bootpd bootpd(8): Fix a typo in a source code comment 2024-01-22 21:46:31 +01:00
comsat Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
dma Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
fingerd Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
flua flua: add fbsd module 2023-09-27 16:00:00 +02:00
ftpd libexec: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
getty libexec: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
hyperv Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
kgdb crashinfo: Print stack traces for all on-CPU threads 2024-01-15 16:36:40 -05:00
mail.local libexec: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
makewhatis.local Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
mknetid libexec: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
phttpget libexec: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
pppoed Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
rbootd libexec: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
rc /etc/rc add trace debug and verify 2024-02-09 09:15:58 -08:00
revnetgroup Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
rpc.rquotad libexec: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
rpc.rstatd libexec: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
rpc.rusersd Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
rpc.rwalld Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
rpc.sprayd Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
rtld-elf rtld-elf: Avoid unnecessary lock_restart_for_upgrade() calls 2024-02-02 09:39:54 -05:00
rtld-elf32 Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
save-entropy save-entropy: Add manual page 2023-09-18 13:33:59 +02:00
smrsh libexec: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
talkd libexec: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
tcpd Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
tftp-proxy Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
tftpd libexec: Automated cleanup of cdefs and other formatting 2023-11-26 22:23:59 -07:00
ulog-helper Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ypxfr Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
Makefile crashinfo: Print stack traces for all on-CPU threads 2024-01-15 16:36:40 -05:00
Makefile.inc libexec: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00