]> granicus.if.org Git - sudo/commitdiff
Fix "sudo -l command" output when the matching command is negated.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 13 Mar 2014 14:21:04 +0000 (08:21 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 13 Mar 2014 14:21:04 +0000 (08:21 -0600)
Bug #636

plugins/sudoers/parse.c

index a5e42147f97b33cf01131c45e6333c5c946ddc9d..4fab89c6b7a8ecfd8afcfc4f8f108337f5bc8a17 100644 (file)
@@ -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;
                    }
                }