Update Defaults settings after parsing sudoers.

Also stub out dump_defaults when fuzzing as it is not used.
This commit is contained in:
Todd C. Miller
2021-02-24 12:29:34 -07:00
parent 33551acd1f
commit cbd11c44d2
4 changed files with 8 additions and 1 deletions

View File

@@ -268,6 +268,7 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
sudoersrestart(fp);
sudoersparse();
reparent_parse_tree(&parse_tree);
update_defaults(&parse_tree, NULL, (SETDEF_ALL & ~SETDEF_USER), false);
if (!parse_error) {
/* Match user/host/command against parsed policy. */
@@ -278,6 +279,8 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
if (sudo_user.pw == NULL)
goto done;
update_defaults(&parse_tree, NULL, SETDEF_USER, false);
sudoers_lookup(&snl, sudo_user.pw, &cmnd_status, false);
/* Match again as a pseudo-command (list, validate, etc). */