git: 7d5d1fae2854 - main - pfctl: odd condition/test in PF lexer
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 04 Jul 2025 09:22:35 UTC
The branch main has been updated by kp:
URL: https://cgit.FreeBSD.org/src/commit/?id=7d5d1fae28541034423763313cca61fa6ed15ae2
commit 7d5d1fae28541034423763313cca61fa6ed15ae2
Author: Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-06-30 12:55:38 +0000
Commit: Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-07-04 08:31:11 +0000
pfctl: odd condition/test in PF lexer
This commit rectifies earlier change:
in the lex... even inside quotes, a \ followed by space or tab should
expand to space or tab, and a \ followed by newline should be ignored
(as a line continuation). compatible with the needs of hoststated
(which has the most strict quoted string requirements), and ifstated
(where one commonly does line continuations in strings).
OK deraadt@, OK millert@
Obtained from: OpenBSD, sashan <sashan@openbsd.org>, a153335958
Sponsored by: Rubicon Communications, LLC ("Netgate")
---
sbin/pfctl/parse.y | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sbin/pfctl/parse.y b/sbin/pfctl/parse.y
index c939b5ae7cce..beff11bebf69 100644
--- a/sbin/pfctl/parse.y
+++ b/sbin/pfctl/parse.y
@@ -6854,7 +6854,8 @@ top:
} else if (c == '\\') {
if ((next = lgetc(quotec)) == EOF)
return (0);
- if (next == quotec || c == ' ' || c == '\t')
+ if (next == quotec || next == ' ' ||
+ next == '\t')
c = next;
else if (next == '\n') {
file->lineno++;