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

Fix alternative options for radio type preferences when exporting a scan config #1278

Merged
merged 1 commit into from
Aug 31, 2020

Conversation

jjnicola
Copy link
Member

@jjnicola jjnicola commented Aug 31, 2020

What:
Add alternative option for radio type nvt's preferences

Why:
When exporting, the alternative options were not added to the xml file.

How:
Importing a scan config and checking the NVT's preferences, search for an radio type pref. Only the default value was shown. Now the alternative values are shown as well.

Checklist:

@@ -8674,13 +8674,6 @@ buffer_config_preference_xml (GString *buffer, iterator_t *prefs,
char *pos = strchr (value, ';');
if (pos) *pos = '\0';
buffer_xml_append_printf (buffer, "<value>%s</value>", value);
while (pos)
Copy link
Contributor

Choose a reason for hiding this comment

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

Surely this hasn't been broken since 2010? I think this worked because OTP sent the alts with the value. Has ospd-openvas stopped doing that?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I think somewhere along the line we lost track of keeping the alts in the preference value in the XML. For example in the feed config XML one radio value includes the alts but the other one does not.

And gvmd was not checking for the alts when importing XML configs, so the values ended up in dbs without alts. My current db has both.

I think using using default_value which comes from the nvts table is a good solution.

@mattmundell mattmundell self-requested a review August 31, 2020 15:48
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