opnsense-src/libexec/rc
Jamie Gritton c96d5c97bb MFC jail: avoid a clash with /etc/jail.conf.d between rc and jail(8)
Since 13.1, /etc/rc.d/jail has looked for a per-jail config file in
/etc/jail.conf.d. For RELENG 14, the ".include" directive was added to
jail(8), with a sample line in the jail.conf(5) man page that includes
"/etc/jail.conf.d/*.conf".

These two use cases don't work together. When the jail.conf.d files
are included from a master jail.conf, the files in jail.conf.d are
likely to hold only partial configurations, and shouldn't be directly
loaded by rc.d/jail. But there are existing configurations that depend
on the current rc.d behavior. While users could be advised not to
include from /etc/jail.conf.d, it's the natural choice even if not
mentioned in jail.conf.5.

The workaround is for rc.d/jail to continue to load the individual
files, but only when /etc/jail.conf doesn't include from that
directory (via a simple grep test), This allows the current use
while not breaking the previous use.

Reported by:	antranigv at freebsd.am
Differential Revision:	https://reviews.freebsd.org/D41962

(cherry picked from commit a2440348eed75bb7682579af0905b652747fd016)
2023-09-27 21:39:00 -07:00
..
rc.d MFC jail: avoid a clash with /etc/jail.conf.d between rc and jail(8) 2023-09-27 21:39:00 -07:00
tests spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD 2023-05-12 10:44:03 -06:00
Makefile Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
netstart Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
network.subr Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
pccard_ether Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
rc Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
rc.bsdextended Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
rc.conf release: update stable/14 following branching from main 2023-08-24 19:07:33 -04:00
rc.firewall Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
rc.initdiskless Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
rc.resume Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
rc.shutdown Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
rc.subr rc.subr: don't require service to be enabled for status 2023-09-24 09:17:43 -04:00
rc.suspend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00