From: Todd C. Miller Date: Tue, 4 Jun 1996 23:57:30 +0000 (+0000) Subject: now always uses fnmatch to match args X-Git-Tag: SUDO_1_5_0~175 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6737221aa5de4e72e770faff18439a48e509702b;p=sudo now always uses fnmatch to match args --- diff --git a/parse.c b/parse.c index 3bb6af677..86ddef3fe 100644 --- a/parse.c +++ b/parse.c @@ -428,15 +428,9 @@ static int compare_args(user_args, sudoers_args) char **ua, **sa; for (ua=user_args, sa=sudoers_args; *ua && *sa; ua++, sa++) { - /* only do wildcard match if there are meta chars */ - /* XXX - is this really any faster than fnmatch() for all? */ - if (has_meta(*sa)) { - if (fnmatch(*sa, *ua, FNM_PATHNAME)) - return(FALSE); - } else { - if (strcmp(*sa, *ua)) - return(FALSE); - } + /* Match and honor wildcards */ + if (fnmatch(*sa, *ua, FNM_PATHNAME) != 0) + return(FALSE); } /*