From a7f9c8162e9efafcc1709e17b766c2d934081994 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 7 Jul 2022 20:28:49 -0600 Subject: [PATCH] Fix compilation error when SUDOERS_NAME_MATCH is defined. --- plugins/sudoers/match_command.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/sudoers/match_command.c b/plugins/sudoers/match_command.c index 049dd873e..c234c1f39 100644 --- a/plugins/sudoers/match_command.c +++ b/plugins/sudoers/match_command.c @@ -391,9 +391,10 @@ command_matches_all(const char *runchroot, debug_decl(command_matches_all, SUDOERS_DEBUG_MATCH); if (user_cmnd[0] == '/') { +#ifndef SUDOERS_NAME_MATCH /* Open the file for fdexec or for digest matching. */ bool open_error = !open_cmnd(user_cmnd, runchroot, digests, &fd); -#ifndef SUDOERS_NAME_MATCH + /* A non-existent file is not an error for "sudo ALL". */ if (do_stat(fd, user_cmnd, runchroot, &sb)) { if (open_error) { @@ -403,6 +404,9 @@ command_matches_all(const char *runchroot, if (!intercept_ok(user_cmnd, intercepted, &sb)) goto bad; } +#else + /* Open the file for fdexec or for digest matching. */ + (void)open_cmnd(user_cmnd, runchroot, digests, &fd); #endif }