Page MenuHomeVyOS Platform

<regex> constraints in XML are partially broken
Closed, ResolvedPublicBUG


The backslash \ symbol in <regex> definitions inside XML templates will be ignored during comparison, this makes unusable any regex which contains it, like:


The problem exists because all regex are converting into node.def as-is. And later, configuration parser considers \ as an escape symbol. So, we need to add escaping of \ before saving it to node.def.

XML: <regex>^\d\w123$</regex>
node.def: syntax:expression: exec "${vyos_libexec_dir}/ --regex \'^\d\w123$\' --value \'$VAR(@)\'"; "Invalid value"
Scripts arguments: ['/usr/libexec/vyos/', '--regex', '^dw123$', '--value', 'test']


Difficulty level
Easy (less than an hour)
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

zsdc created this task.Oct 25 2019, 8:25 PM
pasik added a subscriber: pasik.Oct 27 2019, 5:41 PM
syncer changed the task status from Open to Backport candidate.Nov 16 2019, 10:53 PM
syncer assigned this task to jestabro.
syncer triaged this task as Low priority.
syncer moved this task from Need Triage to Finished on the VyOS 1.3 Equuleus board.
syncer moved this task from Needs Triage to Backlog on the VyOS 1.2 Crux (VyOS 1.2.4) board.
jestabro closed this task as Resolved.Nov 22 2019, 2:05 PM