2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 22:05:46 +00:00

If update_defaults() fails, treat it as a parse error.

This commit is contained in:
Todd C. Miller
2022-07-08 14:01:15 -06:00
parent 3dc8497b48
commit fba81260ad

View File

@@ -655,7 +655,7 @@ reparse_sudoers(char *editor, int editor_argc, char **editor_argv,
}
fclose(sudoersin);
if (!parse_error) {
(void) update_defaults(&parsed_policy, NULL,
parse_error = !update_defaults(&parsed_policy, NULL,
SETDEF_GENERIC|SETDEF_HOST|SETDEF_USER, true);
check_defaults_and_aliases(strict, quiet);
}
@@ -975,7 +975,7 @@ check_syntax(const char *file, bool quiet, bool strict, bool check_owner,
parse_error = true;
}
if (!parse_error) {
(void) update_defaults(&parsed_policy, NULL,
parse_error = !update_defaults(&parsed_policy, NULL,
SETDEF_GENERIC|SETDEF_HOST|SETDEF_USER, true);
check_defaults_and_aliases(strict, quiet);
}