Re-instantiate providing location information to LoadFile hooks.

#1835 subtly changed the semantics of the `LoadFile` plugin hook to no
longer have the current script location available for signature files
being loaded through `@load-sigs`. This was undocumented behavior, so
it's technically not a regression, but since at least one external
plugin is depending on it, this change restores the old behavior.
This commit is contained in:
Robin Sommer 2022-04-14 09:54:45 +02:00
parent d29160e9de
commit fccb9ccab0
No known key found for this signature in database
GPG key ID: 6BEDA4DA6B8B23E3
8 changed files with 66 additions and 11 deletions

View file

@ -1,7 +1,7 @@
# @TEST-EXEC: ${DIST}/auxil/zeek-aux/plugin-support/init-plugin -u . Testing LoadFileExtended
# @TEST-EXEC: cp -r %DIR/plugin-load-file-extended/* .
# @TEST-EXEC: ./configure --zeek-dist=${DIST} && make
# @TEST-EXEC: ZEEK_PLUGIN_PATH=$(pwd) zeek -r $TRACES/wikipedia.trace -b Testing::LoadFileExtended xxx yyy -s abc.sig >> output
# @TEST-EXEC: ZEEK_PLUGIN_PATH=$(pwd) zeek -r $TRACES/wikipedia.trace -b Testing::LoadFileExtended xxx xxx2 yyy -s abc.sig >> output
# @TEST-EXEC: btest-diff output
# @TEST-START-FILE xxx.zeek
@ -12,6 +12,20 @@ event zeek_init() {
# @TEST-END-FILE
# @TEST-START-FILE xxx2.zeek
# Test loading from script land.
@load xxx3
@load-sigs def.sig
# @TEST-END-FILE
# @TEST-START-FILE xxx3.zeek
# empty
# @TEST-END-FILE
# @TEST-START-FILE abc.sig
# empty
# @TEST-END-FILE
# @TEST-START-FILE def.sig
# empty
# @TEST-END-FILE