From nobody Wed Sep 10 19:52:23 2025 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 4cMWYk0SC3z66n69; Wed, 10 Sep 2025 19:52:26 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cMWYg5HGKz3tvX; Wed, 10 Sep 2025 19:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757533943; 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=VdhO8gjoSWa+Y12zX4rtlF50IXawi92WtnJDsQkllbs=; b=lQimIRiWWyYO+nKoYkZcsbuwXx2W9UtKuu9SD8VGyNmZ+PYRu6nppAo26RyLu3/y6R/Z8c 4mWsRPDn+36nL2oVrm1tcfmnsJY+0WEn4bPEeF/Xsn59Aqqn/LIGRLLAPAJxBGOjArRS9W FChxWhKTTr6640pLUFHcBlot9Y0q7ysb5TxEdqN9g2D19HNb6pxI9XKCDzKC9nEd6J3ZUp WAx2a5dZlUI4WgubVpMvuTJRddon7hNwVjhGiMnjBuO9beRZe5bp4S+MuaaRJtLrTF7zY5 utxgqKUtaoP6ubge074fFHy3ygl3/sauHRvreMn9vG/9t44usY/aYaTkIvD51g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1757533943; 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=VdhO8gjoSWa+Y12zX4rtlF50IXawi92WtnJDsQkllbs=; b=uEEbNhidRbrtSeAHuZMDtJuI7JTrOMdD7PSkMkpY1rbLUSn1xX5F7+ktpZE5F3K716d2od YJ6ff1MfYFeRVlD7EvYpzIeNmv8R3UIb4wNO+9gE9wU5WkHs9JjaFP6OSLJjnIzLmWej+X AKBEfNvB8Cqmdyr3A6OdljBRQF7YwMQr6hT51YtGayUJqGO4/xWST+e8UcQL7fuAu3IMnZ CMyphFiLRURDyVBVY3yfIyKVzRoIWWXcTxOSuwI6tGDRUuVS106/jE/Z9sK0kg00dDAxvr 67mRMV9HCK/58qaGPC3+ZH2jDTlRY0n6q0hPtOIZyJfpVZExq+fVAR+xDbLciA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1757533943; a=rsa-sha256; cv=none; b=ZkPK/cPqjky1F1g0P9r9WU9ge9G4P2tcPCgDlFwMsDaIiYs+9HYXklhfMu/ORuCaNcVTkX X6U5TFrII+LOEJlmsifm/6KfYROIIqxFrFA43li8U8+oEYASvbLzrByjSoNDoccZaM29Vy yjrBdHhz0N11iN4w1f04qDJSoZMTZIFWO8C5DEiROWArZ2tWPN8pn3mPM7U+aMsfkEi6/m 8jPwtMnkzUmoE0CSVEHLS+nPj0Glx9ZML5NskuCiEzM2CMJynxxEV+k/sMXw5h3M2bJhiv d6MX7P5c0WzPT39sUuOmLq7urHpX+Ipn6dOZJk/8S5eMx3br4SVq1aNQjpTxmA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cMWYg4qHRzcW1; Wed, 10 Sep 2025 19:52:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 58AJqN2h095270; Wed, 10 Sep 2025 19:52:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 58AJqNHp095267; Wed, 10 Sep 2025 19:52:23 GMT (envelope-from git) Date: Wed, 10 Sep 2025 19:52:23 GMT Message-Id: <202509101952.58AJqNHp095267@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: 66694675be29 - main - pfctl: Use pfctl_fopen 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org 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/main X-Git-Reftype: branch X-Git-Commit: 66694675be291927d1442c62f852ad7f73652aaf Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=66694675be291927d1442c62f852ad7f73652aaf commit 66694675be291927d1442c62f852ad7f73652aaf Author: Kristof Provost AuthorDate: 2025-08-19 11:41:44 +0000 Commit: Kristof Provost CommitDate: 2025-09-10 19:51:39 +0000 pfctl: Use pfctl_fopen Use pfctl_fopen (which checks to ensure the given file isn't a directory) for pfctl -f /path/to/pf.conf. Otherwise, if you accidentally use a dir instead of a file (e.g. if you have an /etc/pf directory and don't notice the name when tab-completing), you successfully install an empty ruleset. ok sashan@ Obtained from: OpenBSD, sthen , 2f48098846 Sponsored by: Rubicon Communications, LLC ("Netgate") --- sbin/pfctl/parse.y | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y index dce5800df27a..46e9f60fe48e 100644 --- a/sbin/pfctl/parse.y +++ b/sbin/pfctl/parse.y @@ -7091,7 +7091,7 @@ pushfile(const char *name, int secret) free(nfile); return (NULL); } - } else if ((nfile->stream = fopen(nfile->name, "r")) == NULL) { + } else if ((nfile->stream = pfctl_fopen(nfile->name, "r")) == NULL) { warn("%s: %s", __func__, nfile->name); free(nfile->name); free(nfile);