From nobody Mon Oct 02 19:23:41 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 4RzrTn6WQYz4wPRQ; Mon, 2 Oct 2023 19:23:41 +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 4RzrTn5xjKz4dtT; Mon, 2 Oct 2023 19:23:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696274621; 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=OZcS0OQ8nrgDlpzkZzP6+LWAJdwKtRaugBXvr+4dTEo=; b=f/B06cBB6L/gWKVvjBYtFQUkcrUo3dk/W86enXzYo3dD7+Q/PbK+hzbUBulWP3VTiUq9zc Y8usvcwnTyTeOvtPrrmTzvrxmPp//mbxyLy8LaxNVe7It21vi3kBBqSP7bDXD09WvJwViU qURWrmYPFKiAtwWmL51l//FTFPhLdWcsBGSNX/XphJ1Eg8j84Td/YoOt4KGUgr1C3IKao7 6Fv1ib7wQO4ddzsWdxBlbEKu4HxN0BLRBWwdAvp4emImfFaFE127gwxCYAa/Je+HYTlojL ktd7irV9NR9uhF0j5f2ROO+a0x3r0wKC+///HdMdduv2bSQlwOqQ0tqopM0fFQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696274621; a=rsa-sha256; cv=none; b=wiQphUzXv3o5mJ2QfcB92TbTla/aAm2ugbBvkEP81RCD56Kbr3Eu5ORAxOS9mZiV8GpJpP gjwarkAYQF9H2l4Oi6gycTtV3oDpoY7mdyFVICeqLrMaH2jEgG13FfcXzpE/bJHYhhX8dd JQhm8FqmtxbEEDrcLr1dyXgq2h1fNBQrC5PISRK+7x1Q1bwXNA+l5tNYmEsNq0OeWd3es6 kPRF8maFh1y2q7gbdwzXRm6iuRpLA+I1BYMNKkRrqeMEJw5KdJ/Gzw2gwAMOBFNJD2qoNK eZ+U4m5ZmjK00O/v1mCTsK3xRJXyAFvHtNErVcY1S156fIg33deaTypnSlIBVg== 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=1696274621; 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=OZcS0OQ8nrgDlpzkZzP6+LWAJdwKtRaugBXvr+4dTEo=; b=bayoDbI5bdop26jtN2LU6vl2HheBkQVkggafS3+Jj0a/Akp3mZJBf0IgNX1TkVdBWKXgoY Rnds+xtknU7x89bywijs10VWEtkdRrkdDdv2nya5iPhNFEtQ5RCI83GdG/jAjaX/6x/ikw 8UK8xQYiy3wakue/3r2/5ZnkNt74ERqX13is1AFnZqK4FRt52dkGG5Krj9A0tzIma6rWdZ 5VWqOuLWP/6d7zuSJqVgaXSNuGdQuuEM6e0kZiczCNHM+sw/iMD4him2bKJQGCNNmkaOgu RFEK6Kl1PFV9aejd8e8AJwQkPZFiYcJRqnSVU8PVJYqtNxlkBsVQ9/8MHg32bQ== 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 4RzrTn4yrPz9MS; Mon, 2 Oct 2023 19:23:41 +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 392JNfSW085071; Mon, 2 Oct 2023 19:23:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 392JNftV085068; Mon, 2 Oct 2023 19:23:41 GMT (envelope-from git) Date: Mon, 2 Oct 2023 19:23:41 GMT Message-Id: <202310021923.392JNftV085068@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: 6a5113a8a1df - releng/14.0 - MFS 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/releng/14.0 X-Git-Reftype: branch X-Git-Commit: 6a5113a8a1df5f93541d2e9af48fd2127bae0793 Auto-Submitted: auto-generated The branch releng/14.0 has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=6a5113a8a1df5f93541d2e9af48fd2127bae0793 commit 6a5113a8a1df5f93541d2e9af48fd2127bae0793 Author: Jamie Gritton AuthorDate: 2023-09-25 00:03:09 +0000 Commit: Jamie Gritton CommitDate: 2023-10-02 19:22:52 +0000 MFS 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. Approved by: re (gjb) Reported by: antranigv at freebsd.am Differential Revision: https://reviews.freebsd.org/D41962 (cherry picked from commit a2440348eed75bb7682579af0905b652747fd016) (cherry picked from commit c96d5c97bb65a1b0bc135b452f13d0ca6a8d60c9) --- 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