From nobody Thu Sep 03 14:03:55 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 4hbLtM5dpYz6rKMj for ; Thu, 03 Sep 2026 14:03:55 +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 4hbLtM44HCz3mMx for ; Thu, 03 Sep 2026 14:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1788444235; 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=tvYF3oRleXvfXmMu+eDUow6sT8c7NWpvX0jNenGxhMw=; b=nDe2/F1QNSjrZHoAE3bMfAD56FYPwh5dVe6gI6nsQyeNfns1P0bq9uwcMXgkQYn9ibhWCc QlnUTk1tp9jdEU+gbRXKEcfTsV6OtOBl6y73JGm9UcCNi4eEClLeZ3PBHObVGWIJSBlsUB Pi4e6Tr8B7o+aZtbznWQivTFMm+fXwtSGssSp4mZN6VIyHuACvUpMsphDkf97AGMNe4Mqj 6T+hdJCawg+1ze2KzE9Jj0YdYSaKME5Mlfkz+IyKAKvo9HcuPVlQZiIbK5XWTsrOkyS/w5 NUT/fTzZ0MmW7PZDbqt4W/td0vmOaOzElLmVnmr3sWDm6tyI2fULJbmPVKPcDg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1788444235; a=rsa-sha256; cv=none; b=gs5QoGRgdkY3HcMUsMWclL/FALVGWLRz81/m74RgT/ukAzFcBVWd56NkdKZYgQvg6icmdV cV6S2bn9vUGT3eqz54fnfW/7RSRZ5kK3CNnDtQZLrSDwCJmm5I5e+wIRNLPZOqYg4AeHs6 Mv6LFBLs+Rjj8uLkBbZFlriV0TAYbFhhqlh8AkpTVEnMx3f4XRqt2suyauVePRYq5xft+p Ah92DHJ5t1hM+0VgGPncaNs3G5uxCBWS92QI2sYaS5udvp81958dep6I6FJ2pxH675O4KQ SlFGq0gqyW8CBt60prx0Lbd0BiJbadPKT5FoyL379bz8BYSk0/SBB4MSJL2KRA== 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=1788444235; 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=tvYF3oRleXvfXmMu+eDUow6sT8c7NWpvX0jNenGxhMw=; b=QcwvBowVTFVdVzwD3FqaEu0+Y/S99UQptCyhFlDgV4eBq+Wjvqhfr3b9mRO8gueEJyQvf5 XOATkIAVD4sSA2lD/EmFeY4Nph8fsPPV7ykiOsKYf7rd0OhCgm27dF40YrU8RkcIAwAALD Tdz/jGpn5FOHRUtou9XS0CgU0AaKIFAl8hQb5J0c8YNSxbREgimKAOJW7iRTBOzNvvhJtE SH2vUJS85ISVlwHEQP67CsCDJzpK5LtH0tlX2RoY00od1qvaD6DZsi3KDDG7SnzaAB9kpa R22G2FLxMo9+61ekhXftAwANu/ZfEnNfR8rGTNMp2/5JstgBHj1mQ5iUAOsrfA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4hbLtM1s6tz1xs for ; Thu, 03 Sep 2026 14:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 20644 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 03 Sep 2026 14:03:55 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 678f107b5c78 - stable/15 - 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/15 X-Git-Reftype: branch X-Git-Commit: 678f107b5c7898570d33d9667217e8901fdc79c6 Auto-Submitted: auto-generated Date: Thu, 03 Sep 2026 14:03:55 +0000 Message-Id: <6a997e4b.20644.74b72c11@gitrepo.freebsd.org> The branch stable/15 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=678f107b5c7898570d33d9667217e8901fdc79c6 commit 678f107b5c7898570d33d9667217e8901fdc79c6 Author: Kristof Provost AuthorDate: 2026-08-26 14:52:07 +0000 Commit: Kristof Provost CommitDate: 2026-09-03 14:03:04 +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 1b0a342337e7..ccf84566fcac 100644 --- a/sbin/pfctl/pfctl.c +++ b/sbin/pfctl/pfctl.c @@ -3178,6 +3178,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) @@ -3364,9 +3365,10 @@ main(int argc, char *argv[]) "be modified from the command line"); 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; } @@ -3417,12 +3419,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 f321c742788e..1f728a6ce0b1 100644 --- a/tests/sys/netpfil/pf/anchor.sh +++ b/tests/sys/netpfil/pf/anchor.sh @@ -538,6 +538,35 @@ recursive_flush_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" @@ -553,4 +582,5 @@ atf_init_test_cases() atf_add_test_case "include" atf_add_test_case "quick" atf_add_test_case "recursive_flush" + atf_add_test_case "show_recursive" }