If the command in sudoers does not exist on the file system, match by name.
We still want to match the command even if it doesn't exist so that the NOPASSWD flag on sudoers entries with non-existant paths works as expected. Bug #888.
This commit is contained in:
@@ -52,6 +52,9 @@ digest_matches(int fd, const char *file, const struct command_digest *digest)
|
||||
size_t digest_len;
|
||||
debug_decl(digest_matches, SUDOERS_DEBUG_MATCH)
|
||||
|
||||
if (fd == -1)
|
||||
goto done;
|
||||
|
||||
file_digest = sudo_filedigest(fd, file, digest->digest_type, &digest_len);
|
||||
if (lseek(fd, (off_t)0, SEEK_SET) == -1) {
|
||||
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_ERRNO|SUDO_DEBUG_LINENO,
|
||||
|
Reference in New Issue
Block a user