]> granicus.if.org Git - sudo/commitdiff
Replace has_meta() with a macro that calls strpbrk().
authorTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 30 Aug 2007 20:15:48 +0000 (20:15 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Thu, 30 Aug 2007 20:15:48 +0000 (20:15 +0000)
match.c

diff --git a/match.c b/match.c
index 0597dfc992745fbdc7f38901fcb09cc82b27dd4f..7dd8a6552cd43a99797ee82b79104243efc01bf5 100644 (file)
--- a/match.c
+++ b/match.c
@@ -94,9 +94,9 @@ __unused static const char rcsid[] = "$Sudo$";
 #endif /* lint */
 
 /*
- * Prototypes
+ * Returns TRUE if string 's' contains meta characters.
  */
-static int has_meta    __P((char *));
+#define has_meta(s)    (strpbrk(s, "\\?*[]") != NULL)
 
 /*
  * Check for user described by pw in a list of members.
@@ -715,20 +715,3 @@ netgr_matches(netgr, lhost, shost, user)
 
     return(FALSE);
 }
-
-/*
- * Returns TRUE if "s" has shell meta characters in it,
- * else returns FALSE.
- */
-static int
-has_meta(s)
-    char *s;
-{
-    char *t;
-    for (t = s; *t; t++) {
-       if (*t == '\\' || *t == '?' || *t == '*' || *t == '[' || *t == ']')
-           return(TRUE);
-    }
-    return(FALSE);
-}