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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Fix delta sorting for unusual filter sort terms [#1249](https://github.com/greenbone/gvmd/pull/1249)
- Fix SCP alert authentication and logging [#1264](https://github.com/greenbone/gvmd/pull/1264)
- Set file mode creation mask for feed lock handling [#1265](https://github.com/greenbone/gvmd/pull/1265)
- Ignore min_qod when getting single results by UUID [#1276](http://github.com/greenbone/gvmd/pull/1276)

### Removed

Expand Down
22 changes: 17 additions & 5 deletions src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -22166,8 +22166,8 @@ init_result_get_iterator_severity (iterator_t* iterator, const get_data_t *get,
int ret;
gchar *filter;
int autofp, apply_overrides, dynamic_severity;
gchar *extra_tables, *extra_where, *owned_clause, *with_clause;
gchar *with_clauses;
gchar *extra_tables, *extra_where, *extra_where_single;
gchar *owned_clause, *with_clause, *with_clauses;
char *user_id;

assert (report);
Expand Down Expand Up @@ -22316,6 +22316,11 @@ init_result_get_iterator_severity (iterator_t* iterator, const get_data_t *get,
autofp, apply_overrides, dynamic_severity,
filter ? filter : get->filter);

extra_where_single = results_extra_where (get->trash, report, host,
autofp, apply_overrides,
dynamic_severity,
"min_qod=0");

free (filter);

user_id = sql_string ("SELECT id FROM users WHERE uuid = '%s';",
Expand Down Expand Up @@ -22369,7 +22374,7 @@ init_result_get_iterator_severity (iterator_t* iterator, const get_data_t *get,
0,
extra_tables,
extra_where,
NULL,
extra_where_single,
TRUE,
report ? TRUE : FALSE,
extra_order,
Expand All @@ -22380,6 +22385,7 @@ init_result_get_iterator_severity (iterator_t* iterator, const get_data_t *get,
g_free (with_clauses);
g_free (extra_tables);
g_free (extra_where);
g_free (extra_where_single);
return ret;
}

Expand All @@ -22404,7 +22410,7 @@ init_result_get_iterator (iterator_t* iterator, const get_data_t *get,
static column_t columns[] = RESULT_ITERATOR_COLUMNS;
static column_t columns_no_cert[] = RESULT_ITERATOR_COLUMNS_NO_CERT;
int ret;
gchar *filter, *extra_tables, *extra_where, *opts_tables;
gchar *filter, *extra_tables, *extra_where, *extra_where_single, *opts_tables;
int autofp, apply_overrides, dynamic_severity;

if (report == -1)
Expand Down Expand Up @@ -22438,6 +22444,11 @@ init_result_get_iterator (iterator_t* iterator, const get_data_t *get,
autofp, apply_overrides, dynamic_severity,
filter ? filter : get->filter);

extra_where_single = results_extra_where (get->trash, report, host,
autofp, apply_overrides,
dynamic_severity,
"min_qod=0");

free (filter);

ret = init_get_iterator2 (iterator,
Expand All @@ -22453,12 +22464,13 @@ init_result_get_iterator (iterator_t* iterator, const get_data_t *get,
0,
extra_tables,
extra_where,
extra_where,
extra_where_single,
TRUE,
report ? TRUE : FALSE,
extra_order);
g_free (extra_tables);
g_free (extra_where);
g_free (extra_where_single);
return ret;
}

Expand Down