Page MenuHomePhabricator

Config nodes containing spaces which have sub-nodes don't work
Closed, ResolvedPublicBUG


Config nodes that can contain spaces and have sub-nodes end up not working correctly. For instance L2TP and PPTP usernames, and SNMP community string. setLevel in ends up not working in that circumstance, which makes the sub-nodes not function. SNMP in that case ends up with an invalid snmpd.conf. L2TP and PPTP users end up with a blank password.


Difficulty level
Normal (likely a few hours)

Event Timeline

Worse, such config can be saved, but cannot be loaded afterwards because the formatter doesn't bother to quote such strings and you end up with a syntactically invalid config.

I'm afraid there may not be a general solution in 1.x.x, but we can identify tag nodes without validation rules and add some rules to them at least.

syncer triaged this task as Normal priority.Aug 1 2017, 4:10 AM
syncer changed the edit policy from "Task Author" to "Custom Policy".
syncer edited projects, added VyOS 1.2 Crux; removed VyOS 1.1.x.
syncer set Version to -.
syncer removed syncer as the assignee of this task.
syncer edited subscribers, added: Maintainers, Core Community, Community; removed: dmbaturin.
syncer added a subscriber: syncer.

Do we need to create sub-task per component?

dmbaturin moved this task from Need Triage to Backlog on the VyOS 1.2 Crux board.May 24 2018, 6:24 PM

Other vendors put in restrictions for that (cisco for instance allows only alpha numerical characters), that could be done in the xml with a regex to prevent the issue you have raised. I only had a look into the snmp configuration for now, but I expect that on many other places too.
Any objections about restricting the input?

Can please someone assign it to me, I was/am working on that one and opened a subtask since I can't assign this one here tom myself.

pasik added a subscriber: pasik.Oct 1 2018, 9:46 AM
syncer changed the subtype of this task from "Task" to "Bug".Oct 18 2018, 5:52 AM

I've finally located the place where tag node output is handled and added quoting analogous to what was always done to leaf node values. Now saved configs should be correct.

@dmbaturin Awesome, I didn't have the time to look into that further. I'm going to test it for sure.

dmbaturin closed this task as Resolved.Oct 29 2018, 5:25 PM
syncer added a project: VyOS-1.2.0-GA.