Skip to content

Commit

Permalink
Fix missing feature toggle check on add & remove tag resources
Browse files Browse the repository at this point in the history
  • Loading branch information
a-h-abdelsalam committed Aug 23, 2024
1 parent d6a267c commit 002fe42
Showing 1 changed file with 28 additions and 24 deletions.
52 changes: 28 additions & 24 deletions src/manage_sql.c
Original file line number Diff line number Diff line change
Expand Up @@ -57366,17 +57366,7 @@ tag_add_resources_filter (tag_t tag, const char *type, const char *filter)
}
else
{
if (strcasecmp (type, "audit_report") == 0)
{
type = g_strdup ("report");
resources_get.type = g_strdup (type);
get_data_set_extra (&resources_get, "usage_type", g_strdup ("audit"));
}
else if (strcasecmp (type, "report") == 0)
{
get_data_set_extra (&resources_get, "usage_type", g_strdup ("scan"));
}
else if (strcasecmp (type, "task") == 0)
if (strcasecmp (type, "task") == 0)
{
get_data_set_extra (&resources_get, "usage_type", g_strdup ("scan"));

Check warning on line 57371 in src/manage_sql.c

View check run for this annotation

Codecov / codecov/patch

src/manage_sql.c#L57371

Added line #L57371 was not covered by tests
}
Expand All @@ -57396,6 +57386,18 @@ tag_add_resources_filter (tag_t tag, const char *type, const char *filter)
{
get_data_set_extra (&resources_get, "usage_type", g_strdup ("scan"));

Check warning on line 57387 in src/manage_sql.c

View check run for this annotation

Codecov / codecov/patch

src/manage_sql.c#L57387

Added line #L57387 was not covered by tests
}
#if COMPLIANCE_REPORTS == 1
else if (strcasecmp (type, "audit_report") == 0)
{
type = g_strdup ("report");
resources_get.type = g_strdup (type);
get_data_set_extra (&resources_get, "usage_type", g_strdup ("audit"));
}
else if (strcasecmp (type, "report") == 0)
{
get_data_set_extra (&resources_get, "usage_type", g_strdup ("scan"));
}
#endif

gchar *columns;

Expand Down Expand Up @@ -57547,19 +57549,7 @@ tag_remove_resources_filter (tag_t tag, const char *type, const char *filter)
}
else
{
if (strcasecmp (type, "audit_report") == 0)
{
type = g_strdup ("report");
resources_get.type = g_strdup (type);
get_data_set_extra (&resources_get,
"usage_type",
g_strdup ("audit"));
}
else if (strcasecmp (type, "report") == 0)
{
get_data_set_extra (&resources_get, "usage_type", g_strdup ("scan"));
}
else if (strcasecmp (type, "task") == 0)
if (strcasecmp (type, "task") == 0)
{
get_data_set_extra (&resources_get, "usage_type", g_strdup ("scan"));

Check warning on line 57554 in src/manage_sql.c

View check run for this annotation

Codecov / codecov/patch

src/manage_sql.c#L57554

Added line #L57554 was not covered by tests
}
Expand All @@ -57579,6 +57569,20 @@ tag_remove_resources_filter (tag_t tag, const char *type, const char *filter)
{
get_data_set_extra (&resources_get, "usage_type", g_strdup ("scan"));

Check warning on line 57570 in src/manage_sql.c

View check run for this annotation

Codecov / codecov/patch

src/manage_sql.c#L57570

Added line #L57570 was not covered by tests
}
#if COMPLIANCE_REPORTS == 1
else if (strcasecmp (type, "audit_report") == 0)
{
type = g_strdup ("report");
resources_get.type = g_strdup (type);
get_data_set_extra (&resources_get,
"usage_type",
g_strdup ("audit"));
}
else if (strcasecmp (type, "report") == 0)
{
get_data_set_extra (&resources_get, "usage_type", g_strdup ("scan"));
}
#endif

gchar *columns;

Expand Down

0 comments on commit 002fe42

Please sign in to comment.