Update Defaults settings after parsing sudoers.
Also stub out dump_defaults when fuzzing as it is not used.
This commit is contained in:
@@ -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). */
|
||||
|
Reference in New Issue
Block a user