Only set MODE_POLICY_INTERCEPTED if we are running a command.

Fixes an error with "sudo -l" when intercept is enabled globally.
This commit is contained in:
Todd C. Miller
2022-07-29 15:17:45 -06:00
parent 25513b4f37
commit 620a563b54

View File

@@ -399,7 +399,7 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
}
/* Was previous command was intercepted? */
if (def_intercept)
if (ISSET(sudo_mode, MODE_RUN) && def_intercept)
SET(sudo_mode, MODE_POLICY_INTERCEPTED);
/* Only certain mode flags are legal for intercepted commands. */