Move logic to execute HookLoadFile for signatures into rule matcher code.

This (1) fixes an issue where signature files supplied on the command
line wouldn't pass through the hooks, and (2) prepares for allowing
hooks to supply the content of a signature file directly.
This commit is contained in:
Robin Sommer 2021-10-07 09:59:15 +02:00
parent f080a814c4
commit 1efaf8d7a4
9 changed files with 94 additions and 40 deletions

View file

@ -10,7 +10,7 @@ namespace zeek::detail
{
std::list<ScannedFile> files_scanned;
std::vector<std::string> sig_files;
std::vector<SignatureFile> sig_files;
ScannedFile::ScannedFile(int arg_include_level, std::string arg_name, bool arg_skipped,
bool arg_prefixes_checked)
@ -47,4 +47,14 @@ bool ScannedFile::AlreadyScanned() const
return rval;
}
SignatureFile::SignatureFile(std::string file)
: file(std::move(file))
{
}
SignatureFile::SignatureFile(std::string file, std::string full_path)
: file(std::move(file)), full_path(std::move(full_path))
{
}
} // namespace zeek::detail