From nobody Thu Sep 03 14:03:57 2026 X-Original-To: dev-commits-src-branches@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 4hbLtQ2szvz6rKjn for ; Thu, 03 Sep 2026 14:03:58 +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 "YR2" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4hbLtP53pgz3mgh for ; Thu, 03 Sep 2026 14:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788444237; 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=Pw2Q/QCXmYzI1Ngi340Fdkf3FtL4qoL9k8n9nE7nTMU=; b=uIIN3Qkwso7KueHEJGopERQkyWoxkYPMtloz5jPgwXGtnJURBBrxMgSiiVug9oHNUvgxqM uM3a0PB+3ptSZW2ENZoQTYNFu/BpZ+d5/IDcZ/lakJigpvb+BL+yOiVuOy0c3eyRfurkTs ol20VZ+rrP3Wo+DjrDAsOE9V6rCmczGna4/HWkVdL7C1fIv1IE1BFpY120UEIs3NoACRZv H5hAd4Br6SjTc1OCXJ3qeW9rtuWMyBA9wLcCQi8DFV7QQwoAWehAbu/2Q909V8dqnu1x2C l3eVW91DxiTaBpYIIrEhC/UO7FjdmEQOxlRsSxUBN90EQHvQURax6NEgGHJu5Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788444237; a=rsa-sha256; cv=none; b=BTODVKbSimUecuHehhzMklq5mACM0VZRFOB4tT6v+gvOioQC1RUUfL+rC8f0krSZo5bI1O UHb0P/KHWEXYntdvZ0GLoPg2gp263R80quuJarJP7mL4qFyZKtW1P5pOvWcaGM6RhDfC4B +eDBY6mOOPmOkcmYmxscrrjPwFqMgQ69+yb+RaHeQv6BbcSC1vRpfkzezy6wn8jFq/82Ad dCApYvHm0Zgl4JrSE+dgh9HE4fLTphNCjpIXNoD1QVMnMtBGUjT8k8K/p+HePDGC8thvEZ aRlFlkYu6s4HxDVFHBvLUDTV3+4cpgI1uqNEdzzbJbqOM2D6y9dC3Vm6gBEC7Q== 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=1788444237; 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=Pw2Q/QCXmYzI1Ngi340Fdkf3FtL4qoL9k8n9nE7nTMU=; b=wYIAeZGWERX+AgHrgk1HU1KSc1cOMT+06A2yFKG3x7S71II0wpo6QryYsP/CWHWyqCtOer CUt3QLXlZDmzDG2CqU7osY9OR5AEC/WRQbUySvpd5o2UXgLxPUSSxFUjOLHUOOERGa2VSs 9cgGiXPJcI13asOX/v/KURL3ZHweXPLey6LnaACuWmL3UGmg/g7/b6XmGD/B/WdVfRbcBJ agAlsqDrJyNsARMztw3eNnuEdE5PpXnHMNzvBu+lYO1U5v4MumNzuT+oYNdt5nPPYP/zlf cvRw1qRqCbFcZaKtV3yoY3XQmW28SN/21DR1FvUzMftpg2Cnr2z+rpDGkwYttQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hbLtP3znFz2CJ for ; Thu, 03 Sep 2026 14:03:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 226ee by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 03 Sep 2026 14:03:57 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 70b70acec779 - stable/14 - pfctl: fix printing of wildcard anchors List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 70b70acec7797961e6c6a8810b8fac4ca3dddd30 Auto-Submitted: auto-generated Date: Thu, 03 Sep 2026 14:03:57 +0000 Message-Id: <6a997e4d.226ee.6b683c3d@gitrepo.freebsd.org> The branch stable/14 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=70b70acec7797961e6c6a8810b8fac4ca3dddd30 commit 70b70acec7797961e6c6a8810b8fac4ca3dddd30 Author: Kristof Provost AuthorDate: 2026-08-26 14:52:07 +0000 Commit: Kristof Provost CommitDate: 2026-09-03 14:03:15 +0000 pfctl: fix printing of wildcard anchors PR: 297839 MFC after: 1 week Obtained from: OpenBSD, henning , 5b6657d4d8 Sponsored by: Rubicon Communications, LLC ("Netgate") (cherry picked from commit 5de5140f06959f2724c626c7fab3e1c9187beefb) --- sbin/pfctl/pfctl.c | 10 ++++++---- tests/sys/netpfil/pf/anchor.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/sbin/pfctl/pfctl.c b/sbin/pfctl/pfctl.c index 50ed978d1a74..083640524523 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -2876,6 +2876,7 @@ main(int argc, char *argv[]) int opts = 0; int optimize = PF_OPTIMIZE_BASIC; char anchorname[MAXPATHLEN]; + int anchor_wildcard = 0; char *path; if (argc < 2) @@ -3043,9 +3044,10 @@ main(int argc, char *argv[]) int len = strlen(anchoropt); if (len >= 1 && anchoropt[len - 1] == '*') { - if (len >= 2 && anchoropt[len - 2] == '/') + if (len >= 2 && anchoropt[len - 2] == '/') { anchoropt[len - 2] = '\0'; - else + anchor_wildcard = 1; + } else anchoropt[len - 1] = '\0'; opts |= PF_OPT_RECURSE; } @@ -3090,12 +3092,12 @@ main(int argc, char *argv[]) case 'r': pfctl_load_fingerprints(dev, opts); pfctl_show_rules(dev, path, opts, PFCTL_SHOW_RULES, - anchorname, 0, 0); + anchorname, 0, anchor_wildcard); break; case 'l': pfctl_load_fingerprints(dev, opts); pfctl_show_rules(dev, path, opts, PFCTL_SHOW_LABELS, - anchorname, 0, 0); + anchorname, 0, anchor_wildcard); break; case 'n': pfctl_load_fingerprints(dev, opts); diff --git a/tests/sys/netpfil/pf/anchor.sh b/tests/sys/netpfil/pf/anchor.sh index da4ef3970d18..511faacc3525 100644 --- a/tests/sys/netpfil/pf/anchor.sh +++ b/tests/sys/netpfil/pf/anchor.sh @@ -206,6 +206,35 @@ nat_cleanup() pft_cleanup } +atf_test_case "show_recursive" "cleanup" +show_recursive_head() +{ + atf_set descr 'Test showing anchors recursively. PR 297839' + atf_set require.user root +} + +show_recursive_body() +{ + pft_init + + vnet_mkjail alcatraz + + pft_set_rules alcatraz \ + "pass in no state" \ + "pass out no state" \ + "anchor \"test/*\"" + + echo 'pass in' | jexec alcatraz pfctl -a test/testing -f - + + atf_check -o match:"pass in" \ + jexec alcatraz pfctl -a 'test/*' -sr +} + +show_recursive_cleanup() +{ + pft_cleanup +} + atf_init_test_cases() { atf_add_test_case "pr183198" @@ -213,4 +242,5 @@ atf_init_test_cases() atf_add_test_case "nested_anchor" atf_add_test_case "wildcard" atf_add_test_case "nat" + atf_add_test_case "show_recursive" }