Commit graph

6667 commits

Author SHA1 Message Date
Jon Siwek
162bc5f1e3 Remove List::append deprecation 2019-07-22 10:58:31 -07:00
Tim Wojtulewicz
6144f459e1 Mark List::append/insert deprecated in favor of push_back/push_front for consistency with Queue 2019-07-22 09:47:43 -07:00
Tim Wojtulewicz
d2d5043bf0 Mark List::sort as deprecated, remove List::sortedinsert 2019-07-22 09:47:43 -07:00
Robin Sommer
1bf0cd29fd Edit pass over changes before merge. 2019-07-20 00:00:51 +00:00
Robin Sommer
1c703f0893 Merge remote-tracking branch 'origin/topic/jsiwek/support-older-plugins'
* origin/topic/jsiwek/support-older-plugins:
  Support old plugins that use files within the source/build tree
2019-07-19 15:50:28 +00:00
Jon Siwek
12b65be771 Remove unused expression type tag: EXPR_MATCH 2019-07-18 19:45:38 -07:00
Jon Siwek
794748dda8 Add missing expr_name: vector_coerce 2019-07-18 19:39:16 -07:00
Zeke Medley
6023157693 Report argument # type check failed on. 2019-07-18 15:22:15 -07:00
Zeke Medley
8a451a24e3 Improve func arg type checking. 2019-07-18 12:20:52 -07:00
Zeke Medley
0ca6b3e013 &expire_func(table, arg1, arg2, ...) + type checking. 2019-07-18 12:11:27 -07:00
Tim Wojtulewicz
e860a4b22d Change container iterators to just use pointers directly into the container elements 2019-07-17 11:04:45 -07:00
Zeke Medley
1692be4c2d Fix bug in selective cloning. 2019-07-16 15:15:05 -07:00
Jon Siwek
4bdcde52bd Support old plugins that use files within the source/build tree
Plugins that were made using an older skeleton (e.g. from Bro 2.5.x)
may still reference "bro-config.h", "bro-path-dev", or "bro" from the
build tree, so we can simply provide compatibility symlinks/wrappers
for the new files that use "zeek" in their names.
2019-07-16 10:10:37 -07:00
Robin Sommer
a45cc53892 Merge remote-tracking branch 'origin/topic/jsiwek/fix-enumtype-shallow-clone'
* origin/topic/jsiwek/fix-enumtype-shallow-clone:
  Fix ref-counting bug in EnumType copy ctor
2019-07-16 15:34:45 +00:00
Robin Sommer
0639fdcd45 Merge remote-tracking branch 'origin/topic/jsiwek/remove-unused-broobj-member'
* origin/topic/jsiwek/remove-unused-broobj-member:
  Remove unused BroObj::in_ser_cache member
2019-07-16 15:19:16 +00:00
Jon Siwek
8c45937798 Merge branch 'topic/jsiwek/template-containers-merge'
* topic/jsiwek/template-containers-merge:
  Fix a potential usage of List::remove_nth(-1)
  Change List::remote(const T&) to return a bool
  Fix debug build due to old int_list usage within assert
  Convert uses of loop_over_list to ranged-for loops
  Remove loop_over_queue (as an example for later removing loop_over_list)
  Change int_list in CCL.h to be a vector, fix uses of int_list to match
  Remove List<> usage from strings.bif
  Replace uses of the old Queue/PQueue generation code with new template versions
  Convert BaseQueue/Queue/PQueue into templates, including iterator support
  Replace uses of the old Dict generation code with new template versions
  Convert PDict into template
  Replace uses of the old List generation code with new template versions
  Convert BaseList/List/PList into templates, including iterator support

* Generally squashed fixups from topic/timw/template-containers

* Add missing include file in List.h: <cassert>
2019-07-15 19:51:27 -07:00
Jon Siwek
5db772aa5e Fix a potential usage of List::remove_nth(-1) 2019-07-15 19:00:24 -07:00
Jon Siwek
ee95fd2801 Change List::remote(const T&) to return a bool
It now indicates whether the removal took place or not, depending
on whether a matching element was found in the list.
2019-07-15 19:00:24 -07:00
Jon Siwek
7ccf3c0a69 Fix debug build due to old int_list usage within assert 2019-07-15 19:00:24 -07:00
Tim Wojtulewicz
e51f02737b Convert uses of loop_over_list to ranged-for loops 2019-07-15 19:00:24 -07:00
Tim Wojtulewicz
bf70dad395 Remove loop_over_queue (as an example for later removing loop_over_list) 2019-07-15 19:00:15 -07:00
Tim Wojtulewicz
a4e2cfa2be Change int_list in CCL.h to be a vector, fix uses of int_list to match 2019-07-15 18:58:48 -07:00
Tim Wojtulewicz
e25caa2666 Remove List<> usage from strings.bif 2019-07-15 18:58:48 -07:00
Tim Wojtulewicz
efa7dbf76b Replace uses of the old Queue/PQueue generation code with new template versions 2019-07-15 18:58:48 -07:00
Tim Wojtulewicz
776da8cb9e Convert BaseQueue/Queue/PQueue into templates, including iterator support 2019-07-15 18:58:05 -07:00
Tim Wojtulewicz
50943a580c Replace uses of the old Dict generation code with new template versions 2019-07-15 18:54:07 -07:00
Tim Wojtulewicz
e2feec52be Convert PDict into template 2019-07-15 18:54:07 -07:00
Tim Wojtulewicz
237c7e4e15 Replace uses of the old List generation code with new template versions 2019-07-15 18:54:07 -07:00
Tim Wojtulewicz
29836b47d0 Convert BaseList/List/PList into templates, including iterator support 2019-07-15 18:54:07 -07:00
Jon Siwek
0058c27bcf Remove unused BroObj::in_ser_cache member 2019-07-15 17:29:20 -07:00
Jon Siwek
db5b73cb8a Fix ref-counting bug in EnumType copy ctor
Which was used by the new ShallowClone method and causes multiple enum
declarations/definitions to now crash.  Such code is not typically
seen in scripts, but being able to define an enum in both .bif and
.bro files has historically been supported.
2019-07-15 12:42:56 -07:00
Tim Wojtulewicz
5d37428819 Fix a couple of resource leaks from JSON changes 2019-07-12 14:31:40 -07:00
Johanna Amann
db79041b19 Merge remote-tracking branch 'origin/topic/timw/157-global-attributes'
* origin/topic/timw/157-global-attributes:
  GH-157: Mark some attributes as not allowed for global variables

Fixes GH-157
2019-07-12 13:45:22 -07:00
Zeke Medley
b83fb5cf95 Sync 3rd party. 2019-07-12 11:12:42 -07:00
Zeke Medley
8d9355eb51 Merge branch 'master' of https://github.com/zeek/zeek into topic/zeke/closures 2019-07-12 10:33:43 -07:00
Zeke Medley
f0798c4b49 Allow serialization of closures over Broker.
anonymous-functions, their closures, can now be sent over broker.
In order to send an anonymous function the receiver must have parsed
a definition of the functon, but it need not to have been evaluated.
See testing/btest/language/closure-sending.zeek for an example of how
this can be done.

This also sends their closures as well as the closures of regular
functions.
2019-07-12 10:31:40 -07:00
Jon Siwek
e5e84041b7 Fix uncaught exceptions from Val cloning failures 2019-07-11 16:55:39 -07:00
Tim Wojtulewicz
ec4913ac18 GH-157: Mark some attributes as not allowed for global variables 2019-07-11 13:34:39 -07:00
Johanna Amann
418ab0e33a Merge remote-tracking branch 'origin/topic/jsiwek/zeekenv-static-local-fix'
* origin/topic/jsiwek/zeekenv-static-local-fix:
  Fix potential thread safety issue with zeekenv util function
2019-07-11 13:30:50 -07:00
Jon Siwek
a2c7ed5ff6 Merge branch 'topic/hui/dnp3-fix' of https://github.com/hugolin615/zeek
* 'topic/hui/dnp3-fix' of https://github.com/hugolin615/zeek:
  fixed some bugs on dnp3 analyzer

Adjusted some inconsistent whitespace.

Fixes GH-421
2019-07-11 13:18:58 -07:00
Jon Siwek
cb292af84d Fix a sign-compare compiler warning 2019-07-11 12:14:27 -07:00
Jon Siwek
9a72a7117d Fix potential thread safety issue with zeekenv util function
Observed segfault accessing the local static std::map of zeekenv() from
a logging thread, but only in non-debug builds using Apple/Clang
compiler, not in a debug build or GCC.  Don't quite get this behavior
since static local variable initialization is supposed to be thread-safe
since C++11, but moving to a global static works and is "more efficient"
anyway since there's no longer any run-time overhead.
2019-07-11 11:41:50 -07:00
Johanna Amann
1f329ad541 Merge remote-tracking branch 'origin/topic/timw/150-to-json'
* origin/topic/timw/150-to-json:
  Update submodules for JSON work
  Update unit tests for JSON logger to match new output
  Modify JSON log writer to use the external JSON library
  Update unit test output to match json.zeek being deprecated and slight format changes to JSON output
  Add proper JSON serialization via C++, deprecate json.zeek
  Add new method for escaping UTF8 strings for JSON output
  Move do_sub method from zeek.bif to StringVal class method
  Move record_fields method from zeek.bif to Val class method
  Add ToStdString method for StringVal
2019-07-11 11:17:32 -07:00
hugo
7fecf9d667 fixed some bugs on dnp3 analyzer 2019-07-10 20:17:35 -07:00
Jon Siwek
31772b1b96 Remove unused option: chunked_io_buffer_soft_cap
Used to be a part of old serialization/communication system.
2019-07-10 18:41:16 -07:00
Tim Wojtulewicz
1af2640f4b Avoid a null dereference (Coverity-1402816) 2019-07-08 16:22:50 -07:00
Tim Wojtulewicz
69023a0c75 Avoid resource leaks (Coverity-1402818, Coverity-1402812) 2019-07-08 16:22:50 -07:00
Tim Wojtulewicz
4db6d00372 Avoid null dereference in broker (Coverity-1402824, Coverity-1402814) 2019-07-08 16:22:50 -07:00
Tim Wojtulewicz
e390244442 Remove unused variable from RecordVal (Coverity-1402820) 2019-07-08 15:18:13 -07:00
Jon Siwek
723793aa9e Merge remote-tracking branch 'origin/topic/timw/clang-tidy'
* origin/topic/timw/clang-tidy:
  Add clang-tidy rule to CMake including a base configuration
2019-07-03 11:51:10 -07:00