-
Notifications
You must be signed in to change notification settings - Fork 158
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
Resolve tags: solution and solution_type #681
Merged
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
This prepares to have both not anymore in the pipe-separated tag list. However, this patch makes the solution appear twice in the nvts table for the time being. Just like solution_type already. This patch expects that there is a additional column in the nvt table "solution." A migrator is forthcoming, for testing this can be done: ALTER TABLE IF EXISTS nvts ADD COLUMN solution text;
This one adds the solution.
This allows to access solution and solution_type when iterating over results.
This also serves get_info for type NVT. The explicit elements "solution" and "solution_type" are appended to the pipe-separated tag element of the nvt. This is a temporary solution until the XML structure of a NVT has explicit solution and solution_type elements. Once that is established, we don't need to append them to the tags anymore.
This appends the explicit stored solution and solutions_type to the pipe-separated tag element. Once the solution and solution_type are explicit elements of the XML definition, this can be dropped.
Since solution and solution_type are now appended to the tag string for API compaitibility where the respective XML is created, we do not need to store them into the tag in the database anymmore!
mattmundell
approved these changes
Aug 11, 2019
@@ -15561,6 +15561,8 @@ update_nvti_cache () | |||
nvti_set_family (nvti, iterator_string (&nvts, 2)); | |||
nvti_set_cvss_base (nvti, iterator_string (&nvts, 3)); | |||
nvti_set_tag (nvti, iterator_string (&nvts, 4)); | |||
nvti_set_solution (nvti, iterator_string (&nvts, 5)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really related ;)
if (result_iterator_nvt_solution_type (results)) | ||
{ | ||
if (tags->str) | ||
g_string_append_printf (tags, "|solution_type=%s", result_iterator_nvt_solution_type (results)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines are getting long. Timo and I still pretty much always stick to the old 80 characters rule.
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.
Internally stores solution explicitely in the nvts table like solution_type already was.
Remove solution and solution_type from the tag element of the nvts table by
actually not adding them anymore.
However, stay compatible with the API which means to append solution
and solution_type to the tag when creating a XML for the VT (get_nvts, get_results,
get_info).
In summary this is a plain internal change with no API change.
However, the API change for VT XML is prepared with one more step.
greenbone/gvm-libs#255 is required for this change.
Checklist: