opnsense-src/stand
Cyrus Rahman b39f500e6a stand: lines with comments a '"' in loader.conf are ignored
So the problem is that the lua parser in /boot/lua/config.lua is
splitting the line on the '=', sending the first match to the key and
the second to the value.

In the problem case, the value is:
   '"test b"               # This is "test_directive_b"'
Then the value gets matched against QVALEXPR = '"(.*)"'.

This cleans up the value by removing the first and last '"', but in this
case turns it into:
  test b"               # This is "test_directive_b
which then gets rejected in processEnvVar() with MSG_FAILSYN_QUOTE,
since values aren't allowed to contain '"'.

Changing QVALEXPR to '([-%w_]+)' fixes this problem.  Since the value is
explicitly prevented from containing quotes, it's not unreasonable to
load it from an expression that excludes them.  The only other place
this is used is in the 'exec="command"' expression, which also should
not contain '"' in the command value.

PR: 265001
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D35975
2025-03-16 08:46:57 -06:00
..
arm64 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
common loader.efi: add "gop blt <on|off>" command 2025-02-20 21:50:20 +02:00
defaults loader.conf: Document boot_verbose 2025-02-09 11:24:22 -07:00
efi loader.efi: smbios: Favor the v3 (64-bit) entry point 2025-03-11 14:54:10 +01:00
fdt Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
ficl stand: Remove dangling mips references 2024-02-28 07:09:41 -07:00
ficl32 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
fonts Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
forth loader: set boot_safe when safe mode is selected 2024-12-13 22:31:28 -06:00
i386 stand: use globals for the kernel and module types 2025-01-24 14:29:39 -07:00
images Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
kboot loader.kboot: smbios: Add a comment about v3 entry point being favored 2025-03-11 14:54:11 +01:00
kshim stand/kshim: Replace devclass_equal with calls to strcmp 2025-01-10 23:03:32 -05:00
liblua Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
liblua32 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libofw Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
libsa libsa: smbios_probe(): Strictly obey specified entry point address 2025-03-11 14:54:10 +01:00
libsa32 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
lua stand: lines with comments a '"' in loader.conf are ignored 2025-03-16 08:46:57 -06:00
man loader: set boot_safe when safe mode is selected 2024-12-13 22:31:28 -06:00
powerpc ports/filesystems: Fix fallout 2025-01-27 15:03:10 -05:00
uboot stand: use globals for the kernel and module types 2025-01-24 14:29:39 -07:00
usb stand/usb: Quiet warnings so this builds again 2025-01-10 23:03:32 -05:00
userboot stand: use globals for the kernel and module types 2025-01-24 14:29:39 -07:00
defs.mk Add option to clear caller-used registers on function return. 2025-01-22 19:33:23 +01:00
fdt.mk stand: Rename LIBFDT to LIBSAFDT 2023-11-07 09:57:32 -05:00
ficl.mk Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
loader.mk loader/loader.mk: add docs for LOADER_*_SUPPORT variables 2024-10-24 20:26:26 -06:00
lua.mk Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
Makefile loader: Don't need the arch list 2024-11-12 22:01:24 -07:00
Makefile.amd64 Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.inc Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
veriexec.mk libsecureboot do not report expected unverified files 2024-02-12 14:35:01 -08:00