Fix a bug introduced in rev. 1.149. When checking for pseudo-commands
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 2 Aug 2004 18:40:39 +0000 (18:40 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 2 Aug 2004 18:40:39 +0000 (18:40 +0000)
check for a '/' anywhere in cmnd, not just the first character.

parse.c

diff --git a/parse.c b/parse.c
index ba5a8785028d9abb313aec0c28bb8e7f0a4c7965..01e3d67dcf796d508c4a777a00ca0090582b7d94 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -245,7 +245,7 @@ command_matches(cmnd, cmnd_args, path, sudoers_args)
     static char *cmnd_base;
 
     /* Check for pseudo-commands */
-    if (*cmnd != '/') {
+    if (strchr(cmnd, '/') == NULL) {
        /*
         * Return true if cmnd is "sudoedit" AND
         *  a) there are no args in sudoers OR