Skip to content

Commit

Permalink
Merge pull request #1276 from timopollmeier/single-result-ignore-qod-…
Browse files Browse the repository at this point in the history
…20.08

Ignore min_qod when getting single results by UUID
  • Loading branch information
bjoernricks authored Aug 27, 2020
2 parents d970d4e + 80113cd commit 676bbf6
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
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

0 comments on commit 676bbf6

Please sign in to comment.