Skip to content

Conversation

@wkz
Copy link
Contributor

@wkz wkz commented Oct 29, 2025

Description

Refactor copy to make it easier to follow. NACM should now also actually be applied, before this PR, sr_nacm_set_user() was called without first calling sr_nacm_init(), but this was not detected as the return code was not checked. Also plug some Bobby Droptables vectors by invoking curl without shell expansion.

I also added a small test script to test the most common use-cases. Its execution is not automated, but then again we do not muck about in this code that often. Please have a look if there are any glaring holes in that. I would also appreciate some free testing to make sure I have not missed anything major.

Checklist

  • Bugfix
    • Regression tests
    • ChangeLog updates (for next release)
  • Feature
    • YANG model change => revision updated?
    • Regression tests added?
    • ChangeLog updates (for next release)
    • Documentation added?
  • Test changes
    • Checked in changed Readme.adoc (make test-spec)
    • Added new test to group Readme.adoc and yaml file
  • Code style update (formatting, renaming)
  • Refactoring (please detail in commit messages)
  • Build related changes
  • Documentation content changes
    • ChangeLog updated (for major changes)
  • Other (please describe):

wkz added 3 commits October 29, 2025 16:35
Add a simple script that verifies all the common use-cases of copy.
copy() made some...creative...use of control flow that made it quite
difficult to follow.

Take a first priciples approach to simplify the logic.
This will make sure to apply NACM rules for all the data. It also
makes it possible for a luser access a subset of the data, even if
they to do not have read access to /cfg/startup-config.cfg.
@wkz wkz requested review from mattiaswal and troglobit October 29, 2025 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants