Page MenuHomeVyOS Platform

GRUB variables with `=` in a value are parsed improperly
Closed, ResolvedPublicBUG

Description

If a GRUB configuration contains variables with =, they are parsed improperly. For example:

set cmdline_extra="nosmt mitigations=off pci=nocrs"

is parsed by https://github.com/vyos/vyos-1x/blob/e3a04ea99108a2c4fbe1f95e93621fbf81bf750d/python/vyos/system/grub.py#L244 as:

{
    'cmdline_extra="nosmt mitigations=off pci': 'nocrs'
}

The problem is in regex: https://github.com/vyos/vyos-1x/blob/e3a04ea99108a2c4fbe1f95e93621fbf81bf750d/python/vyos/system/grub.py#L52

In a very rare but real cases this can break config files.

Details

Difficulty level
Easy (less than an hour)
Version
1.4.0, 1.5-rolling-202406060020
Why the issue appeared?
Implementation mistake
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)

Event Timeline

zsdc changed the task status from Open to In progress.Jun 6 2024, 8:09 PM
zsdc claimed this task.
zsdc moved this task from Need Triage to In Progress on the VyOS 1.5 Circinus board.
zsdc added a project: VyOS 1.4 Sagitta.
syncer triaged this task as Normal priority.Jun 6 2024, 9:43 PM
c-po moved this task from In Progress to Finished on the VyOS 1.4 Sagitta (1.4.1) board.
dmbaturin changed Why the issue appeared? from Will be filled on close to Implementation mistake.