diff --git a/CHANGELOG.md b/CHANGELOG.md index cbf388a75..0969c8751 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/manage_sql.c b/src/manage_sql.c index 5f6f6a4a6..e69c16713 100644 --- a/src/manage_sql.c +++ b/src/manage_sql.c @@ -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) {