diff --git a/CHANGELOG.md b/CHANGELOG.md index f89e5d304..8d4608f54 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/). - Switch result filter column 'task' from task ID to name task name [#1317](https://github.com/greenbone/gvmd/pull/1317) - Correct check of get_certificate_info return [#1318](https://github.com/greenbone/gvmd/pull/1318) - Fix GMP doc text of `active` elem for notes and overrides [#1323](https://github.com/greenbone/gvmd/pull/1323) +- Account for -1 of orphans when deleting permission [#1345](https://github.com/greenbone/gvmd/pull/1345) - Move feed object in trash checks to startup [#1325](https://github.com/greenbone/gvmd/pull/1325) - Always check for 'All' when deleting selectors [#1342](https://github.com/greenbone/gvmd/pull/1342) - Do not inherit settings from deleted users [#1328](https://github.com/greenbone/gvmd/pull/1328) diff --git a/src/manage_sql.c b/src/manage_sql.c index e7c288882..c48b2a586 100644 --- a/src/manage_sql.c +++ b/src/manage_sql.c @@ -44381,7 +44381,8 @@ delete_permission (const char *permission_id, int ultimate) cache_permissions_for_resource (resource_type, resource, NULL); /* Update Reports cache */ - if (resource_type && resource && strcmp (resource_type, "override") == 0) + if (resource_type && (resource > 0) && strcmp (resource_type, "override") + == 0) { reports = reports_for_override (resource); } @@ -56123,7 +56124,7 @@ cache_permissions_for_resource (const char *type, resource_t resource, { int free_users; - if (type == NULL || resource == 0) + if (type == NULL || resource == 0 || resource == -1) return; if (cache_users == NULL)