mirror of https://github.com/Icinga/icinga2.git
Make sure that Utility::GlobRecursive doesn't recurse into . and ..
Fixes #5946
This commit is contained in:
parent
bc4cacfee9
commit
70062b5884
|
@ -446,6 +446,9 @@ bool Utility::Glob(const String& pathSpec, const boost::function<void (const Str
|
|||
}
|
||||
|
||||
do {
|
||||
if (strcmp(wfd.cFileName, ".") == 0 || strcmp(wfd.cFileName, "..") == 0)
|
||||
continue;
|
||||
|
||||
if ((wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && !(type & GlobDirectory))
|
||||
continue;
|
||||
|
||||
|
@ -543,6 +546,9 @@ bool Utility::GlobRecursive(const String& path, const String& pattern, const boo
|
|||
}
|
||||
|
||||
do {
|
||||
if (strcmp(wfd.cFileName, ".") == 0 || strcmp(wfd.cFileName, "..") == 0)
|
||||
continue;
|
||||
|
||||
String cpath = path + "/" + wfd.cFileName;
|
||||
|
||||
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||
|
|
Loading…
Reference in New Issue