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

Add --rebuild-gvmd-data command line option (Backport #1680) #1681

Merged
merged 13 commits into from
Sep 7, 2021

Conversation

jhelmold
Copy link
Member

@jhelmold jhelmold commented Sep 7, 2021

What:
Manual backport because the automatic one did not work.

Why:

How did you test it:

Checklist:

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.
@jhelmold jhelmold requested a review from a team as a code owner September 7, 2021 14:03
@jhelmold jhelmold merged commit c77c1a9 into greenbone:gvmd-21.04 Sep 7, 2021
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