opnsense-src/stand/lua
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
..
cli.lua Revert "loader/lua: Remove pager shim" 2024-07-29 16:56:55 -06:00
cli.lua.8 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
color.lua Remove $FreeBSD$: two-line lua tag 2023-08-16 11:55:30 -06:00
color.lua.8 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
config.lua stand: lines with comments a '"' in loader.conf are ignored 2025-03-16 08:46:57 -06:00
config.lua.8 stand/lua: always allow overriding with local config files 2024-02-02 12:04:57 -07:00
core.lua loader: set boot_safe when safe mode is selected 2024-12-13 22:31:28 -06:00
core.lua.8 stand: Print a warning of the loader is too old 2024-07-29 16:57:30 -06:00
drawer.lua stand: Fix brand positioning on framebuffer console 2025-02-24 14:36:10 +00:00
drawer.lua.8 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
gfx-beastie.lua Remove $FreeBSD$: two-line lua tag 2023-08-16 11:55:30 -06:00
gfx-beastiebw.lua Remove $FreeBSD$: two-line lua tag 2023-08-16 11:55:30 -06:00
gfx-fbsdbw.lua Remove $FreeBSD$: two-line lua tag 2023-08-16 11:55:30 -06:00
gfx-orb.lua loader: Fix orb position 2025-01-09 08:13:05 +01:00
gfx-orbbw.lua loader: Fix orb position 2025-01-09 08:13:05 +01:00
gfx.lua.8 loader: Move gfx functions to gfx.lua.8 2024-02-15 20:59:23 -07:00
hook.lua Remove $FreeBSD$: two-line lua tag 2023-08-16 11:55:30 -06:00
hook.lua.8 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
loader.conf.lua.5 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
loader.lua loader: Load platform entropy even without menu 2024-09-22 00:35:48 -07:00
loader.lua.8 loader: Add loader.exit 2024-02-26 20:49:46 -07:00
Makefile Remove residual blank line at start of Makefile 2024-07-15 16:43:39 -06:00
Makefile.depend loader: add target for dirdeps build 2023-11-02 19:35:08 -04:00
menu.lua loader: Rework kernel menu section 2025-01-09 08:13:43 +01:00
menu.lua.8 manuals: Misc syntax fixes 2024-10-15 17:20:47 -03:00
password.lua Remove $FreeBSD$: two-line lua tag 2023-08-16 11:55:30 -06:00
password.lua.8 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00
screen.lua loader: Fix 0 vs 1 confusion for column numbers 2024-09-24 14:18:42 -06:00
screen.lua.8 Remove $FreeBSD$: two-line nroff pattern 2023-08-16 11:55:10 -06:00