]> granicus.if.org Git - sudo/commitdiff
When matching for "sudoedit" in sudoers check both the command the user
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 8 Jul 2004 00:15:37 +0000 (00:15 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 8 Jul 2004 00:15:37 +0000 (00:15 +0000)
typed *and* the command that is listed in the sudoers entry.

parse.c

diff --git a/parse.c b/parse.c
index 94439077cb46b583e30491cc3993f83bc0c401f0..77e2116fccf3154b9e1ac4006de79ad287063ce0 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -249,7 +249,7 @@ command_matches(cmnd, cmnd_args, path, sudoers_args)
         *  b) there are no args on command line and none req by sudoers OR
         *  c) there are args in sudoers and on command line and they match
         */
-       if (strcmp(cmnd, "sudoedit") != 0)
+       if (strcmp(cmnd, "sudoedit") != 0 || strcmp(path, "sudoedit") != 0)
            return(FALSE);
        if (!sudoers_args ||
            (!cmnd_args && sudoers_args && !strcmp("\"\"", sudoers_args)) ||