mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 03:28:19 +00:00
Exclude dot directories when searching ZEEK_PLUGIN_PATH
Dot directories rarely contain anything we would want to load as a dynamic plugin. Even worse, they likely contain files with externally controlled lifetimes which might be removed while we are using them (see e.g., zeek/btest#98). With this patch we do not search _discovered_ dot directories anymore. We continue to load from a user-specified `ZEEK_PLUGIN_PATH`, even if its name starts with a dot. Since this patch changes previous behavior it is a **BREAKING CHANGE**.
This commit is contained in:
parent
599037d215
commit
0896f09081
2 changed files with 24 additions and 0 deletions
|
@ -147,6 +147,10 @@ void Manager::SearchDynamicPlugins(const std::string& dir)
|
|||
if ( strcmp(dp->d_name, "..") == 0 || strcmp(dp->d_name, ".") == 0 )
|
||||
continue;
|
||||
|
||||
// We do not search plugins in discovered dot directories.
|
||||
if ( (dp->d_name[0] == '.') && dp->d_type == DT_DIR )
|
||||
continue;
|
||||
|
||||
string path = dir + "/" + dp->d_name;
|
||||
|
||||
if ( stat(path.c_str(), &st) < 0 )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue