From nobody Thu Sep 28 04:39:39 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Rx13c0jYlz4vWTW; Thu, 28 Sep 2023 04:39:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rx13c07G5z3dL0; Thu, 28 Sep 2023 04:39:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695875980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZzZ3uOvUW5f36npQokMziKneAkv7i81usUIXosKW5Cc=; b=oxx12OnIno+nP2SoWqe1fP+2woh5AwhNeFd3ziWhgitZVppo32H/7TAgjOutNNoaDTKEB7 Hjp57/3GVaLeeZOySj3VE/1WmUFTpIBczu1GdFIjfoDRc9TV6vPEtBXSsLY+xGsY3EfjDE MPsQNZX9+XEPWNChiwtDxzy9YbaYG0GzFZUIYDCVCYYDhGVNjLD4mty29l2AwewvZVJf68 4o3XzJnUopwY05W/3bbw2hu5Q0Glj+Al4QhPJEzf3jiFtC5g/bjFc3L0nyx3+bmG2gZeyW f8p//EFkRjy+MYskMvnhO/KLM2eKAT3FCU8atkT4Xbf12go5ZW9kDYg+IKbz8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695875980; a=rsa-sha256; cv=none; b=B3g5+yE49dPyIYGPIBqICFLHHCJT1ttjcz0jrGSjpQ+NdQJT9UB+JhWh4tfU1qi/3H6rg+ 3YaBQLd0kXIgtDJCa1c3LjpVTXk5jGmh1JXK3nphRCr/H0MHw66j+UUlFz/bEs/UbgDvQr 0Ps3j5YTm8kulWhRPUyevehmzmCfIheHg+eh+NgBMn8EElbsF4t1uDF6/aaM3JGihZy+0p G6clo5tLT2xvZLKBsWh4XgGNg3cUw1NrZXVMWNYEQwWkCiHr/D2ZbAzLO16khp+UWyxRSC LlZZ3t7mV6Y2V+YBwlKuSWPyNBWeNvdEtP3J7yci6zIRxluLT7XpPOoi3bXExQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695875980; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ZzZ3uOvUW5f36npQokMziKneAkv7i81usUIXosKW5Cc=; b=IsEXkgvfJhHO1bo1yfYHGKqWIJ1RL+qbVi73SKRJaqQOwSud+odlNf82vBMZ5+kXRw9gel teFza7Dq5YVegz7hz5MzmS2Uhcs93Gue8ys3VDqjDhVD2vWctkWsYWPQxr7EMimz7nFTg3 uBhP6NMQwNGKGbRPzj311HE7Dk59Tw7iexGgDyCHhifblqZeJ1JtEhuzOW9ufMzFi0ttHk EP4mHirgBT8vnogDu771wPL77mfs48ED6E2jnbNLlHJmnhQq9n9euwtGJ1UI5m9QjmTAAe 1pCJSRqcwjHvHsvk7CGOaLYq0XOZDyoH+gFdtktPgSLKY+zHuASivbp6bYl7lg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Rx13b6Hffz1738; Thu, 28 Sep 2023 04:39:39 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 38S4ddRb089813; Thu, 28 Sep 2023 04:39:39 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38S4dd1m089810; Thu, 28 Sep 2023 04:39:39 GMT (envelope-from git) Date: Thu, 28 Sep 2023 04:39:39 GMT Message-Id: <202309280439.38S4dd1m089810@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jamie Gritton Subject: git: c96d5c97bb65 - stable/14 - MFC jail: avoid a clash with /etc/jail.conf.d between rc and jail(8) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jamie X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: c96d5c97bb65a1b0bc135b452f13d0ca6a8d60c9 Auto-Submitted: auto-generated The branch stable/14 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=c96d5c97bb65a1b0bc135b452f13d0ca6a8d60c9 commit c96d5c97bb65a1b0bc135b452f13d0ca6a8d60c9 Author: Jamie Gritton AuthorDate: 2023-09-25 00:03:09 +0000 Commit: Jamie Gritton CommitDate: 2023-09-28 04:39:00 +0000 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) --- libexec/rc/rc.d/jail | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libexec/rc/rc.d/jail b/libexec/rc/rc.d/jail index f8995c7e3b00..f12dae280bb0 100755 --- a/libexec/rc/rc.d/jail +++ b/libexec/rc/rc.d/jail @@ -126,7 +126,9 @@ parse_options() if [ -r "$_jconf" ]; then _conf="$_jconf" return 0 - elif [ -r "$_jconfdir" ]; then + elif [ -r "$_jconfdir" ] && ! egrep -q \ + '^\s*\.include\s*["'\'']?/etc/jail.conf.d/' "$jail_conf" \ + 2>/dev/null; then _conf="$_jconfdir" return 0 elif [ -r "$jail_conf" ]; then