From d0c333969a6aebbf5d6be270f6758930a6b882bb Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Wed, 10 Dec 2014 14:00:12 -0700 Subject: [PATCH] Remove artificial limit on length of pattern and string. It is possible to use fnmatch() on things other than paths (such as arguments) so a limit of PATH_MAX does not make sense. Fixes a bug where rules would fail to match if the length of the arguments were larger than PATH_MAX (usually 1024). --- lib/util/fnmatch.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/util/fnmatch.c b/lib/util/fnmatch.c index eb4e756fd..8861937d4 100644 --- a/lib/util/fnmatch.c +++ b/lib/util/fnmatch.c @@ -83,7 +83,6 @@ #ifdef HAVE_STRINGS_H # include #endif /* HAVE_STRINGS_H */ -#include #include "sudo_compat.h" #include "compat/charclass.h" @@ -284,9 +283,6 @@ int sudo_fnmatch(const char *pattern, const char *string, int flags) const char *mismatch = NULL; int matchlen = 0; - if (strlen(pattern) > PATH_MAX || strlen(string) > PATH_MAX) - return FNM_NOMATCH; - if (*pattern == '*') goto firstsegment; -- 2.50.1