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

Refactor modify_config, allowing multiple simultaneous changes #1404

Merged
merged 13 commits into from
Feb 9, 2021

Conversation

timopollmeier
Copy link
Member

@timopollmeier timopollmeier commented Feb 3, 2021

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:

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 timopollmeier changed the title Refactor modify_config, allowing multiple changes Refactor modify_config, allowing multiple simultaneous changes Feb 5, 2021
@timopollmeier timopollmeier marked this pull request as ready for review February 5, 2021 08:26
@timopollmeier timopollmeier requested a review from a team as a code owner February 9, 2021 07:27
@timopollmeier timopollmeier merged commit 03ddc05 into greenbone:master Feb 9, 2021
@timopollmeier timopollmeier deleted the modify_config_rewrite branch October 15, 2021 10:15
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