Commit graph

9997 commits

Author SHA1 Message Date
Max Kellermann
662c3aab58 Desc: move realloc() call out of the loop 2020-01-30 19:53:23 +01:00
Max Kellermann
61c3be8e16 SerializationFormat: move realloc() call out of the loop
Reallocate and copy the data only once.
2020-01-30 19:53:23 +01:00
Max Kellermann
ef15467757 PacketDumper: remove unused types 2020-01-30 19:53:23 +01:00
Tim Wojtulewicz
c5b2659b6b Merge remote-tracking branch 'origin/topic/jsiwek/supervisor-coverity-fixes'
* origin/topic/jsiwek/supervisor-coverity-fixes:
  Fix leaked FDs in redirecting supervised node stdout/stderr
  Add checks for failed fcntl calls
  Set Pipe file descriptor flags correctly
2020-01-30 08:44:59 -07:00
Jon Siwek
948cc32844 Fix leaked FDs in redirecting supervised node stdout/stderr 2020-01-29 16:05:39 -08:00
Jon Siwek
fd2c6c56a5 Add checks for failed fcntl calls 2020-01-29 16:04:46 -08:00
Jon Siwek
aac7f6e8f2 Set Pipe file descriptor flags correctly 2020-01-29 16:03:12 -08:00
Jon Siwek
f3e5728bcb Merge branch 'leaks' of https://github.com/MaxKellermann/zeek
* 'leaks' of https://github.com/MaxKellermann/zeek:
  Scope: fix memory leak by removing duplicate copy_string() call
  util, nb_dns: fix off-by-one bugs in strncpy() calls
  Type, util: add `constexpr` to static variables
  Net: remove unused variable
2020-01-29 11:50:09 -08:00
Max Kellermann
a458827292 Scope: fix memory leak by removing duplicate copy_string() call
The `ID` constructor also calls copy_string().
2020-01-29 20:22:16 +01:00
Max Kellermann
32bb019e3a util, nb_dns: fix off-by-one bugs in strncpy() calls
Fortunately, these bugs had no effect because the following lines
overwrote the last character with a null byte.
2020-01-29 20:22:16 +01:00
Max Kellermann
aacf84e552 Type, util: add constexpr to static variables
This allows the compiler to move them to section `.rodata`.
2020-01-29 20:22:16 +01:00
Max Kellermann
2694b4e2c8 Net: remove unused variable 2020-01-29 20:22:16 +01:00
Johanna Amann
ad18014bed Merge remote-tracking branch 'origin/topic/jsiwek/ssl-empty-files'
* origin/topic/jsiwek/ssl-empty-files:
  Skip file analysis for zero-length SSL/TLS data
2020-01-29 11:16:35 -08:00
Robin Sommer
6bcd583836 Merge remote-tracking branch 'origin/topic/jsiwek/supervisor'
* origin/topic/jsiwek/supervisor: (44 commits)
  Add note that Supervisor script APIs are unstable until 4.0
  Move command-line arg parsing functions to Options.{h,cc}
  Add btests for supervisor stem/leaf process revival
  Move supervisor control events into SupervisorControl namespace
  Fix supervisor "destroy" call on nodes not currently alive
  Move supervisor source files into supervisor/
  Address supervisor code re-factoring feedback from Robin
  Convert supervisor internals to rapidjson
  Add Supervisor documentation
  Add supervisor btests
  Improve logging of supervised node errors
  Fix supervised node inheritence of command-line script paths
  Improve normalize_path() util function
  Use a timer to check for death of supervised node's parent
  Improve supervisor checks for parent process termination
  Improve handling of premature supervisor stem exit
  Improve supervisor signal handler safety
  Remove unused supervisor config options
  Cleanup minor Supervisor TODOs
  Improve supervisor debug logging
  ...
2020-01-29 13:11:04 +00:00
Robin Sommer
42a7629695 Update NEWS for naming changes. 2020-01-29 12:38:29 +00:00
Robin Sommer
e1458360e3 Small cleanup and updating submodules. 2020-01-29 12:38:23 +00:00
Robin Sommer
4eeabd5210 Remove test for legacy plugin.
We no longer support creating new plugins using the old naming
scheme.
2020-01-29 12:08:10 +00:00
Robin Sommer
e552a07249 Remove legancy symlinks in aux/.
That's aux/bro-aux and aux/broctl.
2020-01-29 12:08:10 +00:00
Robin Sommer
649301b667 Add warnings when loading scripts ending in ".bro", or using legacy environment variables. 2020-01-29 12:08:10 +00:00
Robin Sommer
bbc308cb02 Fix missing rename. 2020-01-29 12:08:10 +00:00
Robin Sommer
123cbba6be No longer symlink local.zeek to local.bro. 2020-01-29 12:08:10 +00:00
Robin Sommer
ad8e659943 Update notice user agent. 2020-01-29 12:08:10 +00:00
Robin Sommer
a941e3d942 Remove old_comm_usage_is_ok.
That was just a left-over without any functionality.
2020-01-29 12:08:10 +00:00
Robin Sommer
0063a81410 Remove bro-config.h.in and bro-path-dev.in. 2020-01-29 12:08:10 +00:00
Robin Sommer
0516f3f439 Change Bro wrapper script to now abort when old executable names are still used. 2020-01-29 12:08:10 +00:00
Robin Sommer
d0b206fa36 Remove APIs that were explicitly deprecated to be removed in 3.1.
Special handling for bro_{init,done,script_loaded} events: if still
used, they cause Zeek to abort at startup.
2020-01-29 12:08:09 +00:00
Jon Siwek
84b8ee3b06 Merge remote-tracking branch 'origin/topic/jsiwek/cirrus-catalina'
* origin/topic/jsiwek/cirrus-catalina:
  Update Cirrus CI config to use macOS Catalina
2020-01-28 17:56:22 -08:00
Jon Siwek
b9ed77420c Update Cirrus CI config to use macOS Catalina 2020-01-28 16:29:18 -08:00
Jon Siwek
83874fa5fa Merge branch 'getrandom' of https://github.com/MaxKellermann/zeek
- Removed the superfluous check for C++17 in the merge since that's
  a requirement enforced at the CMake-level.

* 'getrandom' of https://github.com/MaxKellermann/zeek:
  util: use getrandom() on Linux if available
2020-01-28 12:45:15 -08:00
Johanna Amann
f126296446 Update submodule
[nomail]
2020-01-28 12:07:03 -08:00
Max Kellermann
cb4258434c util: use getrandom() on Linux if available
Unlike /dev/urandom, getrandom() doesn't need a file descriptor and
works when there is no /dev.  It requires Linux 3.17 and glibc 2.25,
but there is a fallback to the old code.

For simplicity, this patch uses __has_include() to detect the
availability of this API, but maybe we should move that to cmake.

(It might be useful to refactor the whole random gathering code to a
separate function.)
2020-01-28 11:45:25 +01:00
Jon Siwek
069eedb736 Improve kerberos analyzer address and event handling
Adds a weird, "invalid_kerberos_addr_len", for invalid kerberos host
address lengths and also fixes a memory leak when processing KRB_KDC_REQ
and KRB_KDC_REP messages for message types that do not match a
known/expected type.
2020-01-27 17:24:49 -08:00
Jon Siwek
fdfd729206 Add note that Supervisor script APIs are unstable until 4.0 2020-01-27 13:51:01 -08:00
Jon Siwek
53363a9bd3 Move command-line arg parsing functions to Options.{h,cc} 2020-01-27 13:50:44 -08:00
Jon Siwek
5fb01caee6 Add btests for supervisor stem/leaf process revival 2020-01-27 10:58:40 -08:00
Jon Siwek
0412cb3996 Merge branch 'topic/frerich/gh-750-uri-with-empty-portnum' of https://github.com/frerich/zeek
* 'topic/frerich/gh-750-uri-with-empty-portnum' of https://github.com/frerich/zeek:
  Document recent fix for decompose_uri in release notes
  Fixed decompose_uri choking on URIs with empty port component
  Adding test for decompose_uri parsing URI with empty port
2020-01-24 15:16:14 -08:00
Frerich Raabe
4955356a52 Document recent fix for decompose_uri in release notes 2020-01-24 22:24:05 +01:00
Frerich Raabe
bb879fc2aa Fixed decompose_uri choking on URIs with empty port component
A call such as

  decompose_uri("git://git.kernel.org:/pub/scm/linux/");

would raise an error along the lines of

  error in /usr/local/zeek-3.0.0/share/zeek/base/utils/urls.zeek, line 122: bad conversion to count (to_count(parts[1]) and )

This was because an empty string got passsed to the to_count()
function.

Let's improve the behaviour and rather consider the portnum component
of the URI to be uninitialized.
2020-01-24 22:24:00 +01:00
Frerich Raabe
440468a0dc Adding test for decompose_uri parsing URI with empty port
I'd expect the portnum component to remain uninitialized in case the
given URI specifies no port number -- however, decompose_uri() raises an
error instead. Will address this in a subsequent commit.
2020-01-24 22:23:50 +01:00
Jon Siwek
cc8d28089b Updating submodule(s).
[nomail]
2020-01-24 13:18:33 -08:00
Jon Siwek
f45c2cf06b Skip check for outdated docs in Cirrus CI for PRs 2020-01-23 18:10:17 -08:00
Johanna Amann
97bea7c4f1 Merge remote-tracking branch 'origin/topic/jsiwek/fix-create-stream-priorities'
* origin/topic/jsiwek/fix-create-stream-priorities:
  Use consistent zeek_init priority for Log::create_stream calls
2020-01-23 15:31:06 -08:00
Johanna Amann
c306fcf3d7 Make bro_broker::val_to_data take a const Val* instead of a Val 2020-01-23 12:15:38 -08:00
Robin Sommer
fc1c95725b Update Broker submodule.
Includes a test baseline update for change in Broker error message.
2020-01-23 13:51:29 +00:00
Robin Sommer
01b7db5b46 Merge remote-tracking branch 'origin/topic/jsiwek/smb-transaction-strings'
* origin/topic/jsiwek/smb-transaction-strings:
  Improve creation of SMB transaction data strings
2020-01-23 13:19:11 +00:00
Robin Sommer
11850088ee Merge remote-tracking branch 'origin/topic/jsiwek/ftp-word'
* origin/topic/jsiwek/ftp-word:
  Improve FTP word/whitespace handling
2020-01-23 13:14:46 +00:00
Jon Siwek
fce4bb3f50 Improve FTP word/whitespace handling 2020-01-22 19:50:14 -08:00
Jon Siwek
f939bcad7e Skip file analysis for zero-length SSL/TLS data 2020-01-22 16:49:32 -08:00
Johanna Amann
98ad95d00b Merge remote-tracking branch 'origin/master' into topic/johanna/table-changes 2020-01-22 16:02:12 -08:00
Jon Siwek
c75519ca88 Improve creation of SMB transaction data strings 2020-01-22 15:41:50 -08:00