2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

now always uses fnmatch to match args

This commit is contained in:
Todd C. Miller
1996-06-04 23:57:30 +00:00
parent 1e21b9212a
commit 6737221aa5

12
parse.c
View File

@@ -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);
}
/*