From: Todd C. Miller Date: Wed, 10 Dec 2014 21:00:12 +0000 (-0700) Subject: Remove artificial limit on length of pattern and string. It is X-Git-Tag: SUDO_1_8_12^2~64 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0c333969a6aebbf5d6be270f6758930a6b882bb;p=sudo 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). --- 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;