Add back SUDOERS_NAME_MATCH and enable it when fuzzing.

This avoids the test environment from influencing sudoers matching.
This commit is contained in:
Todd C. Miller
2021-02-21 13:39:56 -07:00
parent ecbe95589a
commit 921097cb67
3 changed files with 75 additions and 5 deletions

View File

@@ -38,6 +38,7 @@
#include "sudo_digest.h"
#include <gram.h>
#ifndef SUDOERS_NAME_MATCH
bool
digest_matches(int fd, const char *path, const char *runchroot,
const struct command_digest_list *digests)
@@ -133,3 +134,15 @@ done:
free(file_digest);
debug_return_bool(matched);
}
#else /* SUDOERS_NAME_MATCH */
bool
digest_matches(int fd, const char *path, const char *runchroot,
const struct command_digest_list *digests)
{
debug_decl(digest_matches, SUDOERS_DEBUG_MATCH);
/* Digests are not supported when matching only by name. */
debug_return_bool(false);
}
#endif /* SUDOERS_NAME_MATCH */