-
Notifications
You must be signed in to change notification settings - Fork 153
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
Add --rebuild-gvmd-data command line option (Backport #1680) #1681
Merged
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 function sync_config_with_feed now checks whether a config file has to be synced with the new function should_sync_config_from_path. This will allow a general check if any configs need to be updated later.
The test if a sync is necessary for a report format or port list is moved to a separate function like it was done for configs.
The feed directories for configs, port lists and report formats are now opened in a separate function which can later be reused for a quick feed status check.
Setting the current user is now optional when opening the feed directories for data objects.
Before trying to sync the data objects, check if the feed has any updates first. Also acquire the feed lock for updating the data objects to avoid conflicts with manually triggered updates that are to be added.
The functions sync_configs_with_feed, sync_port_lists_with_feed and sync_report_formats_with_feed will now return postive failure codes if the feed directory or owner does not exist or the NVTs are missing for configs.
The return codes of the functions try_open_configs_feed_dir, try_open_port_lists_feed_dir, try_open_report_formats_feed_dir and the corresponding sync_..._with_feed functions now distinguish between missing feed directory and missing feed owner.
The functions for syncing configs, port lists and report formats now have a `rebuild` parameter to skip the modification time check to force a rebuild.
This option allows forcing a rebuild of the gvmd data via CLI.
Comments for REBUILD_SWITCH and the return values of should_sync_... functions were missing.
The static headers for the sync_[...]_with_feed functions in the manage_sql_[...].c files were missing the rebuild parameter.
timopollmeier
approved these changes
Sep 7, 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:
Manual backport because the automatic one did not work.
Why:
How did you test it:
Checklist: