-
Notifications
You must be signed in to change notification settings - Fork 158
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
Refactor modify_config, allowing multiple simultaneous changes #1404
Merged
timopollmeier
merged 13 commits into
greenbone:master
from
timopollmeier:modify_config_rewrite
Feb 9, 2021
Merged
Refactor modify_config, allowing multiple simultaneous changes #1404
timopollmeier
merged 13 commits into
greenbone:master
from
timopollmeier:modify_config_rewrite
Feb 9, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The modify_config command is rewritten using the new parsing method creating an entity_t of the whole command XML and then processing it. This also moves most of the GMP functionality of the command to gmp_configs.c and allows multiple changes like modifying the name, preferences and nvt_selections at the same time.
The various changes like updating the family selection and preferences are now done in a single transaction instead of multiple ones so the whole modify_config command can be rolled back if an error occurs.
This function is no longer used with the new parsing method.
Instead of getting the config rowid in every modification sub-action, it is only fetched once and then passed to those sub-actions.
The calls to log_event_fail are moved out of the modify_config sub-action handler functions so those no longer need the config_id.
This adds missing documentation to the new helper functions for modify_config and adjusts some existing comments.
It now reflects the change that the command can contain multiple changes at once and notes the influence of the order the changes are sent in.
Some extra spaces at the line ends were removed for clang-format.
timopollmeier
changed the title
Refactor modify_config, allowing multiple changes
Refactor modify_config, allowing multiple simultaneous changes
Feb 5, 2021
nichtsfrei
approved these changes
Feb 9, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What:
The modify_config command is rewritten using the new parsing method
creating an entity_t of the whole command XML and then processing it.
This also moves most of the GMP functionality of the command to
gmp_configs.c and allows multiple changes like modifying the name,
preferences and nvt_selections at the same time.
Why:
To simplify the code and to make the modify_config command more flexible.
How did you test it:
Tested by running the existing config modifications in GSA.
Checklist: