[PATCH] doas: Make backslash mark words as non-keyword
Thomas Habets <[email protected]> Mon, 13 Jul 2026 09:33:40 -0500
| Newsgroups | gmane.os.openbsd.tech |
|---|---|
| Message-ID | <CA+kHd+fLp2Mjh30s28uWPXav0uNttFZwcDePy5b6TFekjO5nsQ@mail.gmail.com> |
Per doas.conf(5)
If quotes or backslashes are used in a word, it is not considered a keyword.
Found with LLM. Patched and confirmed fix manually.
E.g. this is a parse error before the patch, but works after:
```
permit \keepenv
```
diff --git a/usr.bin/doas/parse.y b/usr.bin/doas/parse.y
index 604becb54..32f74f2ab 100644
--- a/usr.bin/doas/parse.y
+++ b/usr.bin/doas/parse.y
@@ -267,6 +267,7 @@ repeat:
escape = 0;
continue;
case '\\':
+ nonkw = 1;
escape = !escape;
if (escape)
continue;