summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2024-06-06 23:04:51 +0300
committerzsdc <taras@vyos.io>2024-06-06 23:04:51 +0300
commitd3acecdf129cd940f8b2d1b229a6e2a343cab74b (patch)
tree91a57c167895896d259ab8c197cfd355b1743aeb /python
parente3a04ea99108a2c4fbe1f95e93621fbf81bf750d (diff)
downloadvyos-1x-d3acecdf129cd940f8b2d1b229a6e2a343cab74b.tar.gz
vyos-1x-d3acecdf129cd940f8b2d1b229a6e2a343cab74b.zip
grub: T6453: Fixed GRUB variables parsing
To parse variables with `=` a variable name should be limited by alphanumerical characters only.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/system/grub.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/vyos/system/grub.py b/python/vyos/system/grub.py
index faf68c2d1..daddb799a 100644
--- a/python/vyos/system/grub.py
+++ b/python/vyos/system/grub.py
@@ -49,7 +49,7 @@ TMPL_GRUB_COMMON: str = 'grub/grub_common.j2'
BOOT_OPTS_STEM: str = 'boot=live rootdelay=5 noautologin net.ifnames=0 biosdevname=0 vyos-union=/boot/'
# prepare regexes
-REGEX_GRUB_VARS: str = r'^set (?P<variable_name>.+)=[\'"]?(?P<variable_value>.*)(?<![\'"])[\'"]?$'
+REGEX_GRUB_VARS: str = r'^set (?P<variable_name>\w+)=[\'"]?(?P<variable_value>.*)(?<![\'"])[\'"]?$'
REGEX_GRUB_MODULES: str = r'^insmod (?P<module_name>.+)$'
REGEX_KERNEL_CMDLINE: str = r'^BOOT_IMAGE=/(?P<boot_type>boot|live)/((?P<image_version>.+)/)?vmlinuz.*$'
REGEX_GRUB_BOOT_OPTS: str = r'^\s*set boot_opts="(?P<boot_opts>[^$]+)"$'