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 definition for NVTICACHE_STR. #176

Merged
merged 2 commits into from
Sep 27, 2018

Conversation

jjnicola
Copy link
Member

@jjnicola jjnicola commented Sep 24, 2018

Depends on greenbone/gvm-libs#124

Assert if a plugin doesn't have a valid category.

Use the gvm-libs release version in the name of the nvticache.
This avoid to use an old nvticache structure stored in redis if a
new gvm-libs version is installed, cleaning the old one and loading up
the NVTs acording to the new structure.

@jjnicola jjnicola requested review from kroosec and a team September 24, 2018 12:12
@jjnicola jjnicola force-pushed the nvticache-str-version branch from c1a9f0a to 95cdbff Compare September 25, 2018 11:17
@jjnicola jjnicola changed the title Add definition for NVTICACHE_STR. Add definition for NVTICACHE_STR. Fix greenbone/openvas-scanner#166 Sep 25, 2018
@jjnicola jjnicola changed the title Add definition for NVTICACHE_STR. Fix greenbone/openvas-scanner#166 Add definition for NVTICACHE_STR. Sep 25, 2018
@@ -139,6 +139,16 @@ plugin_add (plugins_scheduler_t sched, GHashTable *oids_table,
}

category = nvti_category (nvti);
if (category < 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both PRs are good, except this part. IMO, it is better to use an assert(category >= 0) and in the case of an old/corrupted cache, this message would be printed for the thousands of plugins that are loaded.

@jjnicola jjnicola force-pushed the nvticache-str-version branch 2 times, most recently from 4a00cbf to fe41518 Compare September 26, 2018 12:22
Use the gvm-libs release version in the name of the nvticache.
This avoid to use an old nvticache structure stored in redis if a
new gvm-libs version is installed, cleaning the old one and loading up
the NVTs acording to the new structure.
@jjnicola jjnicola force-pushed the nvticache-str-version branch 2 times, most recently from f8d3fac to 47e78cc Compare September 26, 2018 13:00
@kroosec kroosec merged commit f3c8980 into greenbone:master Sep 27, 2018
@jjnicola jjnicola deleted the nvticache-str-version branch October 18, 2018 07:22
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