Merge remote-tracking branch 'origin/topic/timw/2997-ding-dong-bro-init-is-dead'

* origin/topic/timw/2997-ding-dong-bro-init-is-dead:
  Remove parser error message for bro_init, et al
This commit is contained in:
Tim Wojtulewicz 2023-05-03 09:31:19 -07:00
commit 7305f2ba9b
8 changed files with 10 additions and 33 deletions

View file

@ -1,3 +1,7 @@
6.0.0-dev.489 | 2023-05-03 09:31:19 -0700
* Remove parser error message for bro_init, et al (Tim Wojtulewicz, Corelight)
6.0.0-dev.487 | 2023-05-03 09:30:55 -0700 6.0.0-dev.487 | 2023-05-03 09:30:55 -0700
* Add additional length check to IEEE 802.11 analyzer (Tim Wojtulewicz, Corelight) * Add additional length check to IEEE 802.11 analyzer (Tim Wojtulewicz, Corelight)

5
NEWS
View file

@ -59,6 +59,11 @@ Breaking Changes
- The IRC_Data analyzer declaration has been moved to protocols/irc/IRC.h. - The IRC_Data analyzer declaration has been moved to protocols/irc/IRC.h.
- The error message returned when using ``bro_init``, ``bro_done``, and
``bro_script_loaded`` events is now removed. removed. Usage of these events
has returned that error during script parsing for a few years, and time has
come to finally remove it.
New Functionality New Functionality
----------------- -----------------

View file

@ -1 +1 @@
6.0.0-dev.487 6.0.0-dev.489

View file

@ -1488,13 +1488,6 @@ func_hdr:
} }
| TOK_EVENT event_id func_params opt_attr | TOK_EVENT event_id func_params opt_attr
{ {
const char* name = $2->Name();
if ( util::streq("bro_init", name) || util::streq("bro_done", name) || util::streq("bro_script_loaded", name) )
{
auto base = std::string(name).substr(4);
reporter->Error("event %s() is no longer available, use zeek_%s() instead", name, base.c_str());
}
begin_func({NewRef{}, $2}, current_module.c_str(), begin_func({NewRef{}, $2}, current_module.c_str(),
FUNC_FLAVOR_EVENT, false, {NewRef{}, $3}, FUNC_FLAVOR_EVENT, false, {NewRef{}, $3},
std::unique_ptr<std::vector<AttrPtr>>{$4}); std::unique_ptr<std::vector<AttrPtr>>{$4});

View file

@ -1,3 +0,0 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error in <...>/bro_init.zeek, line 5: event bro_init() is no longer available, use zeek_init() instead
error in <...>/bro_init.zeek, line 10: event bro_done() is no longer available, use zeek_done() instead

View file

@ -1,2 +0,0 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error in <...>/bro_script_loaded.zeek, line 5: event bro_script_loaded() is no longer available, use zeek_script_loaded() instead

View file

@ -1,12 +0,0 @@
# @TEST-EXEC-FAIL: zeek -b %INPUT >out 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
event bro_init()
{
print "ran bro_init()";
}
event bro_done()
{
print "ran bro_done()";
}

View file

@ -1,8 +0,0 @@
# @TEST-EXEC-FAIL: zeek -b %INPUT >out 2>&1
# @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-remove-abspath btest-diff out
event bro_script_loaded(path: string, level: count) &priority=5
{
if ( /zeek_script_loaded.zeek/ in path )
print "bro_script_loaded priority 5";
}