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 {
|
do {
|
||||||
|
if (strcmp(wfd.cFileName, ".") == 0 || strcmp(wfd.cFileName, "..") == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
if ((wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && !(type & GlobDirectory))
|
if ((wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) && !(type & GlobDirectory))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
@ -543,6 +546,9 @@ bool Utility::GlobRecursive(const String& path, const String& pattern, const boo
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
if (strcmp(wfd.cFileName, ".") == 0 || strcmp(wfd.cFileName, "..") == 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
String cpath = path + "/" + wfd.cFileName;
|
String cpath = path + "/" + wfd.cFileName;
|
||||||
|
|
||||||
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
if (wfd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||||
|
|
Loading…
Reference in New Issue