From nobody Mon Sep 25 00:13:58 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 4Rv3JR0v7sz4thv9; Mon, 25 Sep 2023 00:13:59 +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 4Rv3JQ66hwz3JlK; Mon, 25 Sep 2023 00:13:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695600838; 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=t6SxypLw9UxuTu0/p6UVXJ7JsrBpB9o62PRi9mi28ZY=; b=xzAKKYZJ/rR65jfqe7YI6eTOpTxjdhfq6rZI98/SQcgchHMAbOVjOotvvqPLeADApvk5lS 43Rx1YG+rSht1LMqm2Y7NWDj+hd/piCHoA0s6MALUtxuNshlx3rxY13A+G/o6v46bBB0p2 AVK+95DEDOUF7mUiuy1xUWfGldDE0663hXzyRx/7uTC7Awjg2/l+yL8Q+co8rGIxDxoBGn J19pO4WEKBhN4gl2y4nGxxCI6e0dygchnNhPaDMZMqdjUV8zusuFe7MFQexpyzIub+wd21 Ixt2CLsmv3R4XvRG8p47gZJhZ78qOiALtshgyZMPlQxU24na/gO9M9axCPCHJQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695600838; a=rsa-sha256; cv=none; b=k0a/HDFg1JZKpvdizVUwf1K84711f8uBSLmTczm8U4XnW7Rnu3t2hHSnHtqfe7+oK1ntOJ OZmLwL1ZxImyXOsnAJWOdUnEbeZSPRb5S+y8ND270FoDIE7obOwYXnjfKbcVtKi8BcTJbh AyShmgXedX8Di0lN3kwkfxchEeNm3V4wuiek1uez6oM+taPhyB56W39z5OtjvhPnG/BQCB nhoMYF99th4jn5Bsaqe4+uQk79avuFWqaItnRrX66m2hN6GG52Of2LQrMaVvlYudr4j0nq 7n9TxKVYPb03p7Ec46a2S9Ylv7xNXax+zJGKt1vGO/o5bmNWzEa4tKwm/hqCGA== 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=1695600838; 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=t6SxypLw9UxuTu0/p6UVXJ7JsrBpB9o62PRi9mi28ZY=; b=y3+aKZD8OlrVy6P4oHqQnJPIGKoBjc0yOss9Ar4SsLdew8Uzbqn7vrhS9eNf5YXFAprvL4 oNSMzpIYvbSnmhhPWk1TE4zkwwPhIRlfxW8MPAInotU2BUKBPzaTUjEG5Aj+RVooHxGFRf vYGhmViJs4+uRNSURzQGOHapHjnFkI88oc8FxpIKjzPiKhPUWK8JmW0A8RpYk6dGUaIOpm qHEvufvk3Vv6fNi26M9G+oeRYoFsQUQXUZiwJzFAy1xIQhHK71Rff6x4Hu4FiwV9nb9DKa O47ga636XB1guWU4EYRyfslVk4iEDEHqzzTzpYCMdjdsLoYvWH/ys3vbk2gi7w== 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 4Rv3JQ5B3hz170Y; Mon, 25 Sep 2023 00:13:58 +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 38P0DwoL078789; Mon, 25 Sep 2023 00:13:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38P0Dw4U078786; Mon, 25 Sep 2023 00:13:58 GMT (envelope-from git) Date: Mon, 25 Sep 2023 00:13:58 GMT Message-Id: <202309250013.38P0Dw4U078786@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jamie Gritton Subject: git: a2440348eed7 - main - 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/main X-Git-Reftype: branch X-Git-Commit: a2440348eed75bb7682579af0905b652747fd016 Auto-Submitted: auto-generated The branch main has been updated by jamie: URL: https://cgit.FreeBSD.org/src/commit/?id=a2440348eed75bb7682579af0905b652747fd016 commit a2440348eed75bb7682579af0905b652747fd016 Author: Jamie Gritton AuthorDate: 2023-09-25 00:03:09 +0000 Commit: Jamie Gritton CommitDate: 2023-09-25 00:03:09 +0000 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 --- 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