From 5793af2132e9f901cdc6a95da6fd7a5e4fb11087 Mon Sep 17 00:00:00 2001 From: zsdc Date: Thu, 6 Jun 2024 23:04:51 +0300 Subject: grub: T6453: Fixed GRUB variables parsing To parse variables with `=` a variable name should be limited by alphanumerical characters only. (cherry picked from commit d3acecdf129cd940f8b2d1b229a6e2a343cab74b) --- python/vyos/system/grub.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/vyos/system/grub.py b/python/vyos/system/grub.py index 0d9c1340b..6f3bbdaf6 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.+)=[\'"]?(?P.*)(?\w+)=[\'"]?(?P.*)(?.+)$' REGEX_KERNEL_CMDLINE: str = r'^BOOT_IMAGE=/(?Pboot|live)/((?P.+)/)?vmlinuz.*$' REGEX_GRUB_BOOT_OPTS: str = r'^\s*set boot_opts="(?P[^$]+)"$' -- cgit v1.2.3