Skip to content

Commit

Permalink
Merge pull request #912 from timopollmeier/get_aggregates-usage_type-9.0
Browse files Browse the repository at this point in the history
Apply usage_type of tasks in get_aggregates (9.0)
  • Loading branch information
mattmundell authored Dec 23, 2019
2 parents ac3a4a6 + b7cbe85 commit dd35144
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Use right format specifier for merge_ovaldef version [#874](https://github.com/greenbone/gvmd/pull/874)
- Fix creation of "Super" permissions [#892](https://github.com/greenbone/gvmd/pull/892)
- Setup general task preferences to launch an osp openvas task. [#898](https://github.com/greenbone/gvmd/pull/898)
- Apply usage_type of tasks in get_aggregates (9.0) [#912](https://github.com/greenbone/gvmd/pull/912)

### Removed
- Remove 1.3.6.1.4.1.25623.1.0.90011 from Discovery config (9.0) [#847](https://github.com/greenbone/gvmd/pull/847)
Expand Down
16 changes: 12 additions & 4 deletions src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -64720,17 +64720,25 @@ type_extra_where (const char *type, int trash, const char *filter,

if (strcasecmp (type, "CONFIG") == 0 && extra_params)
{
gchar *usage_type = g_hash_table_lookup (extra_params, "usage_type");
gchar *usage_type;
if (extra_params)
usage_type = g_hash_table_lookup (extra_params, "usage_type");
else
usage_type = NULL;

extra_where = configs_extra_where (usage_type);
if (extra_where == NULL)
extra_where = g_strdup ("");
}
else if (strcasecmp (type, "TASK") == 0)
{
if (trash)
extra_where = g_strdup (" AND hidden = 2");
gchar *usage_type;
if (extra_params)
usage_type = g_hash_table_lookup (extra_params, "usage_type");
else
extra_where = g_strdup (" AND hidden = 0");
usage_type = NULL;

extra_where = tasks_extra_where (trash, usage_type);
}
else if (strcasecmp (type, "TLS_CERTIFICATE") == 0)
{
Expand Down

0 comments on commit dd35144

Please sign in to comment.