mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
zeek-setup: Validate plugin debug streams during startup
Providing an unknown plugin debug stream with -B was previously silently accepted. This caused user confusing as the behavior is "no output, but seems to work". Check the enabled debug streams once all plugins have been loaded and exit early on for invalid streams. $ ZEEK_PLUGIN_PATH=./build zeek -B plugin-zeek-myplugin -e 'print zeek_version();' error in <command line>, line 3: No plugin debug stream 'plugin-zeek-myplugin' found Closes #913.
This commit is contained in:
parent
8ba44c656a
commit
d703033ae6
5 changed files with 58 additions and 3 deletions
|
@ -847,6 +847,20 @@ SetupResult setup(int argc, char** argv, Options* zopts)
|
|||
exit(success ? 0 : 1);
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
// Check debug streams. Specifically that all plugin-
|
||||
// streams are valid now that the active plugins are known.
|
||||
std::set<std::string> active_plugins;
|
||||
for ( const auto p : plugin_mgr->ActivePlugins() )
|
||||
active_plugins.insert(p->Name());
|
||||
|
||||
if ( ! debug_logger.CheckStreams(active_plugins) )
|
||||
{
|
||||
early_shutdown();
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
|
||||
packet_mgr->InitPostScript(options.unprocessed_output_file.value_or(""));
|
||||
analyzer_mgr->InitPostScript();
|
||||
file_mgr->InitPostScript();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue