Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: add missing returns in modify_config_run #2243

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions src/gmp_configs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,12 +1026,18 @@
config_id = attr_or_null (entity, "config_id");

if (config_id == NULL)
SEND_TO_CLIENT_OR_FAIL
(XML_ERROR_SYNTAX ("modify_config",
"A config_id attribute is required"));
{
SEND_TO_CLIENT_OR_FAIL

Check warning on line 1030 in src/gmp_configs.c

View check run for this annotation

Codecov / codecov/patch

src/gmp_configs.c#L1030

Added line #L1030 was not covered by tests
(XML_ERROR_SYNTAX ("modify_config",
"A config_id attribute is required"));
return;

Check warning on line 1033 in src/gmp_configs.c

View check run for this annotation

Codecov / codecov/patch

src/gmp_configs.c#L1033

Added line #L1033 was not covered by tests
}
else if (config_predefined_uuid (config_id))
SEND_TO_CLIENT_OR_FAIL (XML_ERROR_SYNTAX ("modify_config",
"Permission denied"));
{
SEND_TO_CLIENT_OR_FAIL (XML_ERROR_SYNTAX ("modify_config",

Check warning on line 1037 in src/gmp_configs.c

View check run for this annotation

Codecov / codecov/patch

src/gmp_configs.c#L1037

Added line #L1037 was not covered by tests
"Permission denied"));
return;

Check warning on line 1039 in src/gmp_configs.c

View check run for this annotation

Codecov / codecov/patch

src/gmp_configs.c#L1039

Added line #L1039 was not covered by tests
}

// Find the config
switch (manage_modify_config_start (config_id, &config))
Expand All @@ -1053,6 +1059,7 @@
SEND_TO_CLIENT_OR_FAIL
(XML_INTERNAL_ERROR ("modify_config"));
log_event_fail ("config", "Scan Config", config_id, "modified");
return;

Check warning on line 1062 in src/gmp_configs.c

View check run for this annotation

Codecov / codecov/patch

src/gmp_configs.c#L1062

Added line #L1062 was not covered by tests
}

// Handle basic attributes and elements
Expand Down
Loading