From: Todd C. Miller Date: Thu, 13 Mar 2014 14:21:04 +0000 (-0600) Subject: Fix "sudo -l command" output when the matching command is negated. X-Git-Tag: SUDO_1_8_10p1^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35c41deb41c1a681b5b612e14868f37d9f68f32b;p=sudo Fix "sudo -l command" output when the matching command is negated. Bug #636 --- diff --git a/plugins/sudoers/parse.c b/plugins/sudoers/parse.c index a5e42147f..4fab89c6b 100644 --- a/plugins/sudoers/parse.c +++ b/plugins/sudoers/parse.c @@ -697,7 +697,8 @@ sudo_file_display_cmnd(struct sudo_nss *nss, struct passwd *pw) if (runas_match == ALLOW) { cmnd_match = cmnd_matches(cs->cmnd); if (cmnd_match != UNSPEC) { - match = host_match && runas_match ? cs->cmnd : NULL; + if (cmnd_match == ALLOW) + match = cs->cmnd; goto matched; } }