Commit graph

13480 commits

Author SHA1 Message Date
Tim Wojtulewicz
ec450147e6 GH-2261: Fix type used for analyzer_confirmation/violation events 2022-07-13 12:50:15 -07:00
Christian Kreibich
48486b4156 Merge branch 'topic/christian/gh-2239-stdin-ctrl-c'
* topic/christian/gh-2239-stdin-ctrl-c:
  Stop signal-masking upon running unit tests
  Pause signal-masking during script parsing
  Add btests to verify Zeek's handling of SIGTERM and reading stdin
  Add procps/procps-ng to several CI Docker images
2022-07-13 11:57:52 -07:00
Tim Wojtulewicz
ed2934d345 Merge remote-tracking branch 'origin/topic/bbannier/format-btest_testing_plugins'
* origin/topic/bbannier/format-btest_testing_plugins:
  Use clang-format for all files in `testing/btest/plugins`.
2022-07-13 11:23:45 -07:00
Tim Wojtulewicz
fc60b1cd33 Merge remote-tracking branch 'origin/topic/timw/696-bytestring-to-float'
* origin/topic/timw/696-bytestring-to-float:
  GH-696: Add bytestring_to_float BIF
2022-07-13 11:11:57 -07:00
Tim Wojtulewicz
7e56605d83 GH-696: Add bytestring_to_float BIF 2022-07-13 10:44:24 -07:00
Benjamin Bannier
489534bd74 Use clang-format for all files in testing/btest/plugins.
This is a fixup commit for dc65b6248c.
2022-07-13 17:58:53 +02:00
Johanna Amann
96a14b39fa Merge remote-tracking branch 'origin/topic/neverlord/gh-2192'
* origin/topic/neverlord/gh-2192:
  Avoid race conditions in broker.ssl-mismatch test
2022-07-13 09:34:43 +01:00
Johanna Amann
3d043cfa12 Merge branch 'update' of https://github.com/leres/zeek
* 'update' of https://github.com/leres/zeek:
  Restore accidently deleted line
  Fix tail -F semantics when want_record=F and add tests for the new features
2022-07-13 09:30:42 +01:00
Craig Leres
6b19e8d310 Restore accidently deleted line 2022-07-12 22:33:53 -07:00
Christian Kreibich
6228a00d8f Bump cmake submodule for test-naming policy fix [skip ci] [nomail] 2022-07-12 18:08:58 -07:00
Craig Leres
44ba9138c2 Fix tail -F semantics when want_record=F and add tests for the new features
While writing a test for the new "tail -F semantics" I found that
the $want_record=F case was broken (errno 25). So instead of opening
/dev/null when the input file is missing change READER_RAW to avoid
I/O until it can be opened.

Add two tests, one for when the event handler is called with a
record and one for when it's called with a string.
2022-07-12 17:57:50 -07:00
zeek-bot
5954d9d36c Update doc submodule [nomail] [skip ci] 2022-07-13 00:48:15 +00:00
Tim Wojtulewicz
6b4c99c64a Merge remote-tracking branch 'origin/topic/timw/more-bro-renaming'
* origin/topic/timw/more-bro-renaming:
  Rename bro_version and BRO_PLUGIN_BRO_VERSION to zeek names
  Update binpac, bifcl, and gen-zam submodules for renaming changes
  Deprecate BRO_PLUGIN_API_VERSION, create zeek::PLUGIN_API_VERSION
  Deprecate HOOK_BRO_OBJ_DTOR and related methods
  Miscellaneous deprecations and renaming
  Rename all of bro lexer methods and such
  Stop installing the bro symlink, it's been long enough
  Deprecate bro_inet_ntop.{c,h}
  Deprecate bro_int_t and bro_uint_t
2022-07-12 14:18:05 -07:00
Tim Wojtulewicz
a9328b5c44 Rename bro_version and BRO_PLUGIN_BRO_VERSION to zeek names 2022-07-12 13:58:42 -07:00
Tim Wojtulewicz
25c63ed7ab Update binpac, bifcl, and gen-zam submodules for renaming changes 2022-07-12 13:58:42 -07:00
Tim Wojtulewicz
99bc16073a Deprecate BRO_PLUGIN_API_VERSION, create zeek::PLUGIN_API_VERSION 2022-07-12 12:01:23 -07:00
Tim Wojtulewicz
1496b99a34 Deprecate HOOK_BRO_OBJ_DTOR and related methods 2022-07-12 12:01:23 -07:00
Tim Wojtulewicz
4d4c6280e9 Miscellaneous deprecations and renaming 2022-07-12 12:01:23 -07:00
Tim Wojtulewicz
d875ad1a96 Rename all of bro lexer methods and such 2022-07-12 12:01:23 -07:00
Tim Wojtulewicz
8829292c0c Stop installing the bro symlink, it's been long enough 2022-07-12 12:01:23 -07:00
Tim Wojtulewicz
18ae40277a Deprecate bro_inet_ntop.{c,h} 2022-07-12 12:01:23 -07:00
Tim Wojtulewicz
f624c18383 Deprecate bro_int_t and bro_uint_t 2022-07-12 12:01:23 -07:00
Tim Wojtulewicz
d066013793 Merge remote-tracking branch 'origin/topic/timw/btest-cleanup'
* origin/topic/timw/btest-cleanup:
  Run clang-format on all of our plugin test c++ files
2022-07-12 12:00:19 -07:00
Tim Wojtulewicz
dc65b6248c Run clang-format on all of our plugin test c++ files 2022-07-12 11:59:55 -07:00
Christian Kreibich
b59bfe5558 Merge branch 'topic/christian/gh-2259-fix-dir-test'
* topic/christian/gh-2259-fix-dir-test:
  Fix race condition in scripts.base.utils.dir test
  Remove needless "touch" in scripts.base.utils.dir test
2022-07-11 17:29:42 -07:00
Christian Kreibich
3d87400f1d Fix race condition in scripts.base.utils.dir test
The sequence of

- adding a new file
- deleting an existing one
- waiting for Zeek to notice the addition
- re-adding the pre-existing file

was prone to a race: it could happen that Zeek's directory observation would see
the new file in one round, and by the time the next round happens the removal
and re-addition had already happened, thus missing the change and failing the
test.

This avoids the race by placing the removal of the existing file before the
addition of the new one, ensuring that when Zeek notices the addition (and
pushes the test to the next round), it has also seen the removal, so the
re-addition cannot get lost.
2022-07-11 16:26:45 -07:00
Christian Kreibich
e2a7b890ed Remove needless "touch" in scripts.base.utils.dir test
This touch happened after teardown of Zeek, so didn't add to the test.
2022-07-11 16:05:37 -07:00
Tim Wojtulewicz
f3313df743 Merge remote-tracking branch 'origin/topic/bbannier/issue-2238'
* origin/topic/bbannier/issue-2238:
  Fix default build with `--disable-cpp-tests`.
2022-07-11 09:47:00 -07:00
Tim Wojtulewicz
c4ccc37789 Merge remote-tracking branch 'origin/topic/vern/lambda-profiling-fix'
* origin/topic/vern/lambda-profiling-fix:
  fix for script profiling of lambda functions
2022-07-11 09:45:25 -07:00
Tim Wojtulewicz
1226aa538a Merge remote-tracking branch 'origin/topic/vern/zam-vector-cond-fix'
* origin/topic/vern/zam-vector-cond-fix:
  Fix for ZAM optimization of '?' conditional with vector-valued result
2022-07-11 09:44:05 -07:00
Robin Sommer
8df0d02528 Bump documentation. 2022-07-11 12:52:12 +02:00
Robin Sommer
62e9bf5628 Merge remote-tracking branch 'origin/topic/awelzel/policy-pattern-literal-dots'
* origin/topic/awelzel/policy-pattern-literal-dots:
  policy: Use literal dots for patterns used against content-type and hostname
2022-07-11 12:51:08 +02:00
Arne Welzel
c4970e6d4a policy: Use literal dots for patterns used against content-type and hostname
The following two patterns were identified while reviewing patterns that
match on any characters. The intention likely was to match actual
literal dots.
2022-07-11 10:34:47 +02:00
Christian Kreibich
9607deeae0 Stop signal-masking upon running unit tests
It helps to be able to ctrl-c these.
2022-07-10 21:50:47 -07:00
Dominik Charousset
d3ad3c618a Avoid race conditions in broker.ssl-mismatch test 2022-07-10 15:47:43 +02:00
Christian Kreibich
9138d5c64e Pause signal-masking during script parsing
Script parsing includes reading script content from stdin, which in turn
includes interactive Zeek sessions. Keeping the signals masked there broke
ctrl-c behavior.
2022-07-09 11:19:41 -07:00
Christian Kreibich
5beb68194d Add btests to verify Zeek's handling of SIGTERM and reading stdin
The core.load-stdin test checks Zeek's ability to read scripts from stdin.
core.sigterm-regular and core.sigterm-stdin verify that SIGTERM shuts down a
Zeek process during normal operation and while reading script content from
stdin, respectively. For technical reasons we don't test with SIGINT, as ctrl-c
would trigger -- see comments for details.
2022-07-09 11:17:14 -07:00
Benjamin Bannier
b13f8f4dd4 Fix default build with --disable-cpp-tests.
For a build configured with `--disable-cpp-tests` we globally set
`-DDOCTEST_CONFIG_DISABLE`. Spicy does not expect this define to be used
and its unit tests fail to build with it.

This patch adds a Zeek-side workaround for that. We now do not build the
Spicy unit test targets as part of `ALL` anymore.

Closes #2238.
2022-07-09 12:57:32 +02:00
Christian Kreibich
963b27f054 Add procps/procps-ng to several CI Docker images
It helps to have "ps" available for testing.
2022-07-09 00:52:44 -07:00
zeek-bot
d957f883df Update doc submodule [nomail] [skip ci] 2022-07-09 00:43:07 +00:00
Tim Wojtulewicz
c697c8e19f Merge remote-tracking branch 'origin/topic/timw/fix-broken-broker-convert-call'
* origin/topic/timw/fix-broken-broker-convert-call:
  Fix usage of broker::convert(double,timespan)
2022-07-08 10:13:12 -07:00
Tim Wojtulewicz
a266d32dca Fix usage of broker::convert(double,timespan) 2022-07-08 09:57:12 -07:00
Tim Wojtulewicz
0728676fd6 Merge remote-tracking branch 'origin/topic/timw/avoid-extra-reallocs'
* origin/topic/timw/avoid-extra-reallocs:
  Avoid calling safe_realloc unnecessarily from ODesc::Grow()
2022-07-08 09:55:47 -07:00
Tim Wojtulewicz
c9127715c0 Avoid calling safe_realloc unnecessarily from ODesc::Grow() 2022-07-08 09:55:16 -07:00
Robin Sommer
e8e6fa8fed Merge remote-tracking branch 'origin/topic/awelzel/913-plugin-debug-stream-validation'
One change: turns out that zeek-config isn't in PATH, so I prefixed it
with $BUILD.

* origin/topic/awelzel/913-plugin-debug-stream-validation:
  zeek-setup: Validate plugin debug streams during startup
2022-07-08 10:00:39 +02:00
Christian Kreibich
28b7ec2cc5 Bump broker and zeek-archiver submodules to pull in CI updates 2022-07-07 14:20:24 -07:00
Christian Kreibich
23cac286f3 Merge branch 'topic/christian/ci-update'
* topic/christian/ci-update:
  CI: add FreeBSD 13.1 and fix broken link
  CI: Add OpenSUSE Tumbleweed
  CI: drop Ubuntu 21.10, EOL 2022-07-14
  CI: drop Debian 9, EOL 2022-06-30
2022-07-07 14:14:15 -07:00
Vern Paxson
0706e8869d Fix for ZAM optimization of '?' conditional with vector-valued result 2022-07-07 13:08:28 -07:00
Vern Paxson
77ca9ae013 fix for script profiling of lambda functions 2022-07-07 11:01:54 -07:00
Arne Welzel
d703033ae6 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.
2022-07-07 17:56:19 +02:00