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

Ignore min_qod when getting single results by UUID #1276

Merged

Conversation

timopollmeier
Copy link
Member

@timopollmeier timopollmeier commented Aug 27, 2020

What:

Prevents results being hidden by implicit or explicit min_qod filters when selecting results by UUID.

This is an alternative solution to the issue in #1275 that also allows using other filter options like apply_overrides=1.

Why:

This error making get_results return no result at all was introduced in c9dc67a.
Before this special filter options like min_qod were simply ignored by
init_get_iterator2_with when getting single results, ensuring the result
would be visible.

How:

Response from GMP commands like these should include the result, even if result has min_qod < 70:

  • <get_results result_id="e89920a5-9af3-47af-975c-cb38cccdea69" filter="min_qod=70"/>
  • <get_results result_id="e89920a5-9af3-47af-975c-cb38cccdea69" filter="min_qod=0"/>
  • <get_results result_id="e89920a5-9af3-47af-975c-cb38cccdea69"/>

Checklist:

This fixes an issue with the default min_qod being applied to selections
by UUID, thus hiding the result if its QoD was lower.

This error was introduced in c9dc67a.
Before this special filter options like min_qod were simply ignored by
init_get_iterator2_with when getting single results.
@timopollmeier timopollmeier marked this pull request as ready for review August 27, 2020 09:33
@bjoernricks bjoernricks self-requested a review August 27, 2020 09:38
Copy link
Contributor

@bjoernricks bjoernricks left a comment

Choose a reason for hiding this comment

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

Looks good to me. If requesting a single results the filter will always use min_qod=0 independent of the filter from the user.

@bjoernricks bjoernricks merged commit 676bbf6 into greenbone:gvmd-20.08 Aug 27, 2020
@mattmundell
Copy link
Contributor

Doesn't this change the behaviour of GET_RESULTS from gvmd <20.08 though?

In gvmd <20.08 there was no extra_where_single arg for init_get_iterator2_with, so none of the filtering would reach the SQL when an id was given.

This was consistent with the other types, that ignore the filter when an id is given, for example

<get_targets target_id="47ab4d8a-eba3-11ea-9fb4-13d9aeb88196" filter="name=abc"/>

does not return an empty response when the target's name is 'def'.

@timopollmeier timopollmeier deleted the single-result-ignore-qod-20.08 branch October 15, 2021 10:15
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.

3 participants