mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 07:38:19 +00:00
Add a Reporter::fatal BIF.
This can be used from a Bro script to cause Bro to exit with non-zero status and a message to stderr. Uses of the exit() BIF in scripts for terminating Bro because of an error were replaced with this one, which addresses #564.
This commit is contained in:
parent
562abfb0d1
commit
31e70e447d
4 changed files with 12 additions and 5 deletions
|
@ -348,10 +348,7 @@ event bro_init() &priority=10
|
|||
for ( pi in policy )
|
||||
{
|
||||
if ( pi$priority < 0 || pi$priority > 10 )
|
||||
{
|
||||
print "All Notice::PolicyItem priorities must be within 0 and 10";
|
||||
exit();
|
||||
}
|
||||
Reporter::fatal("All Notice::PolicyItem priorities must be within 0 and 10");
|
||||
|
||||
if ( pi$priority !in tmp )
|
||||
tmp[pi$priority] = set();
|
||||
|
|
|
@ -119,7 +119,7 @@ function install()
|
|||
NOTICE([$note=Compile_Failure,
|
||||
$msg=fmt("Compiling packet filter failed"),
|
||||
$sub=default_filter]);
|
||||
exit();
|
||||
Reporter::fatal(fmt("Bad pcap filter '%s'", default_filter));
|
||||
}
|
||||
|
||||
# Do an audit log for the packet filter.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue