Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

T5996: selectively escape and restore single backslashes in config #3035

Merged
merged 2 commits into from Mar 19, 2024

Conversation

jestabro
Copy link
Contributor

@jestabro jestabro commented Feb 20, 2024

Change Summary

Gory details are summarized in the task, but the short story is that the legacy and modern parser and config output have conflicting practices in handling unescaped backslashes --- the existing filter to allow parsing of legacy output requires a refinement, in order to maintain the occasional use of single backslashes in values.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

Proposed changes

How to test

vyos@vyos# set interfaces ethernet eth0 description 'fo\o'
[edit]
vyos@vyos# compare
[interfaces ethernet eth0]
+ description "fo\o"

[edit]
vyos@vyos# commit
[edit]
vyos@vyos# run show configuration commands |match desc
set interfaces ethernet eth0 description 'fo\o'
[edit]
vyos@vyos# set interfaces ethernet eth0 description 'fo\\o'
[edit]
vyos@vyos# compare
[interfaces ethernet eth0]
- description "fo\o"
+ description "fo\\o"

[edit]
vyos@vyos# commit
[edit]
vyos@vyos# run show configuration commands |match desc
set interfaces ethernet eth0 description 'fo\\o'

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

@jestabro jestabro self-assigned this Feb 20, 2024
@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, sever-sever and c-po and removed request for a team February 20, 2024 17:35
@jestabro jestabro marked this pull request as draft February 21, 2024 14:08
@jestabro
Copy link
Contributor Author

Move to draft temporarily to fix detail in regex.

@jestabro jestabro marked this pull request as ready for review February 21, 2024 14:53
@vyosbot vyosbot requested a review from a team February 21, 2024 14:54
@jestabro
Copy link
Contributor Author

Will add a smoketest.

@jestabro jestabro marked this pull request as draft March 5, 2024 15:02
@jestabro
Copy link
Contributor Author

jestabro commented Mar 5, 2024

Converted to draft pending resolution of
https://vyos.dev/T6098#178963
--- restoring unicode support interacts poorly with above.

@jestabro
Copy link
Contributor Author

jestabro commented Mar 8, 2024

The conflict mentioned above will be resolved by T6111:
vyos/vyos1x-config#23
at which point, this can be moved out of draft.

@jestabro jestabro marked this pull request as ready for review March 18, 2024 14:16
@jestabro jestabro marked this pull request as draft March 18, 2024 14:58
@jestabro jestabro marked this pull request as ready for review March 18, 2024 17:20
@jestabro jestabro merged commit e59de1c into vyos:current Mar 19, 2024
9 checks passed
@jestabro
Copy link
Contributor Author

@Mergifyio backport sagitta

Copy link

mergify bot commented Apr 19, 2024

backport sagitta

✅ Backports have been created

c-po added a commit that referenced this pull request Apr 20, 2024
T5996: selectively escape and restore single backslashes in config (backport #3035)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 participants