Commit graph

13262 commits

Author SHA1 Message Date
Bernhard Amann
76ea182387 make want_record=T the default for events 2012-07-26 21:13:49 -07:00
Robin Sommer
f5862fb014 Preventing writers/readers from receiving further messages after a
failure.

Once a writer/reader Do* method has returned false, no further ones
will be executed anymore. This is primarily a safety mechanism to make
it easier for writer/reader authors as otherwise they would often need
to track the failure state themselves (because with the now delayed
termination from the earlier commit, furhter messages can now still
arrive for a little bit).
2012-07-26 17:27:56 -07:00
Robin Sommer
86ae7d8b7c Test for input framework failing to find a file.
The output isn't the nicest yet ...
2012-07-26 17:27:56 -07:00
Robin Sommer
743fc1680d Improving error handling for threads.
If a thread command fails (like the input framework not finding a
file), that now (1) no longer hangs Bro, and (2) even allows for
propagating error messages back before the thread is stops.

(Actually, the thread doesn't really "stop"; the thread manager keeps
threads around independent of their success; but it no longer polls
them for input.)

Closes #858.
2012-07-26 17:27:34 -07:00
Robin Sommer
ef3b75129f Updating baseline for custom-rotate test. 2012-07-26 15:38:12 -07:00
Robin Sommer
d262a70509 Merge remote-tracking branch 'origin/fastpath'
Small tweak: I added the "same writer" constraint to the loop
condition as well. Makes sense?

* origin/fastpath:
  Change path conflicts between log filters to be auto-corrected.
2012-07-26 15:30:35 -07:00
Robin Sommer
412bebb703 Tweaking the custom-rotate test to produce stable output.
There seems to be a race condition in capturing the external shell's
stdout output reliably. As far as I can tell, Bro's doing everything
correctly though, the log postprocessors gets executed as expected. So
I rewrote the test to capture the output in a separate file first, and
that seems to solve the test failures.
2012-07-26 15:25:48 -07:00
Jon Siwek
63e8bf72ed Change path conflicts between log filters to be auto-corrected.
This change makes it so when differing logging filters on the same
stream attempt to write to the same writer/path combination, the path
of the filter doing the later write will be automatically adjusted so
that it does not conflict with the other.  The path is adjusted by
appending "-N", where N is the smallest integer greater or equal to 2
required to resolve the path name conflict.

Addresses #842.
2012-07-26 16:55:49 -05:00
Robin Sommer
951444ee73 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  and remove superflous print.
  add testcase for subrecords and events add missing binary testcase (Baseline is in master, testcase is missing for some reason) make error output for nonmatching event types much more verbose
  Add more error handling for close() calls.
  add testcase for subrecords to input framework tests
2012-07-26 14:34:58 -07:00
Bernhard Amann
8633d91c40 and remove superflous print.
Yes, I know, look at the diff before committing...
2012-07-26 12:15:06 -07:00
Bernhard Amann
4a959c1a33 Merge remote-tracking branch 'origin/fastpath' into fastpath 2012-07-26 12:13:46 -07:00
Bernhard Amann
1a49363bbe add testcase for subrecords and events
add missing binary testcase (Baseline is in master, testcase is missing for some reason)
make error output for nonmatching event types much more verbose
2012-07-26 12:12:54 -07:00
Jon Siwek
a3ac3b8568 Merge branch 'fastpath' of git://git.bro-ids.org/bro into fastpath 2012-07-26 12:41:20 -05:00
Jon Siwek
734e5f68d3 Add more error handling for close() calls. 2012-07-26 12:40:12 -05:00
Bernhard Amann
84399c5d7d add testcase for subrecords to input framework tests 2012-07-26 08:58:12 -07:00
Robin Sommer
d872b1d9f6 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix double close() in FilerSerializer class.
  Fix build warnings
  Fixes to elasticsearch plugin to make libcurl handle http responses correctly.
2012-07-25 17:21:09 -07:00
Jon Siwek
c48a16664b Fix double close() in FilerSerializer class. 2012-07-25 18:05:42 -05:00
Daniel Thayer
c3aba199f6 Fix build warnings 2012-07-25 17:40:21 -05:00
Bernhard Amann
d29e691da9 ...adapt to new api... 2012-07-25 15:05:08 -07:00
Bernhard Amann
da157c8ded Merge remote-tracking branch 'origin/master' into topic/bernhard/sqlite
Conflicts:
	scripts/base/frameworks/logging/__load__.bro
	src/CMakeLists.txt
	src/logging.bif
	src/types.bif
2012-07-25 15:04:23 -07:00
Seth Hall
f2a0afad3c Fixes to elasticsearch plugin to make libcurl handle http responses correctly. 2012-07-25 17:01:47 -04:00
Robin Sommer
a33e9a6941 Fixing FreeBSD compiler error. 2012-07-25 13:58:23 -07:00
Robin Sommer
7e228f1d6b Silencing compiler warnings. 2012-07-25 13:58:08 -07:00
Robin Sommer
626c6d6d5b Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix complaint from valgrind about uninitialized memory usage.
  Fix differing log filters of streams from writing to same writer/path.
  Fix tests and error message for to_double BIF
2012-07-25 13:10:14 -07:00
Jon Siwek
4abcfa1f66 Fix complaint from valgrind about uninitialized memory usage. 2012-07-25 12:42:46 -05:00
Jon Siwek
2fafadd930 Fix differing log filters of streams from writing to same writer/path.
Since WriterFrontend objects are looked up internally by writer type and
path, and they also expect to write consistent field arguments, it could
be the case that more than one filter of a given stream attempts to
write to the same path (derived either from $path or $path_func fields
of the filter) with the same writer type.  This won't work, so now
WriterFrontend objects are bound to the filter that instantiated them so
that we can warn about other filters attempting to write to the
conflicting writer/path and the write can be skipped.  Remote logs don't
appear to suffer the same issue due to pre-filtering.

Addresses #842.
2012-07-25 12:20:12 -05:00
Daniel Thayer
91522e7836 Fix tests and error message for to_double BIF 2012-07-25 12:10:47 -05:00
Robin Sommer
5af131e303 Compile fix. 2012-07-24 16:10:52 -07:00
Robin Sommer
28c5723775 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Correct a typo
  Fix file permissions of log files
2012-07-24 16:02:41 -07:00
Daniel Thayer
3a8f812f1c Correct a typo 2012-07-24 17:32:04 -05:00
Robin Sommer
9e97f7c2aa Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix memory leak when processing a thread's input message fails.
  add comparator functor to the info maps of readerbackend and readerwriteend.
  Fix initialization of WriterFrontend names.
2012-07-24 15:22:52 -07:00
Daniel Thayer
b9a76d7ed0 Fix file permissions of log files
A recent commit was erroneously causing new log files to be created with
execute permissions.
2012-07-24 17:21:30 -05:00
Daniel Thayer
063fd204cc Merge remote-tracking branch 'origin/master' into fastpath 2012-07-24 17:13:05 -05:00
Robin Sommer
f5214c0793 Merge remote-tracking branch 'origin/topic/bernhard/input-fixes'
* origin/topic/bernhard/input-fixes:
  fix problem with possible access to unititialized memory (thanks robin :) )
  and just to be a little bit careful - add check if the field description is long enough. Otherwise there might possibly be an access of uninitialized memory, when someone reads a file that contains just #fields without any following field descriptions.
  and like nearly always - forgot the baseline.
  Input framework now accepts escaped ascii values as input.
  make reading ascii logfiles work when the input separator is different from \t.
2012-07-24 15:08:35 -07:00
Robin Sommer
c36a449c76 New built-in function to_double(s: string).
Closes #859.
2012-07-24 15:05:13 -07:00
Robin Sommer
43752b3d9f Reverting accidentally committed changes.
Thanks, Bernhard!
2012-07-24 11:16:03 -07:00
Robin Sommer
0d748c117d Adding missing include needed on some systems. 2012-07-24 11:06:34 -07:00
Jon Siwek
d6da8365f5 Merge branch 'fastpath' of git://git.bro-ids.org/bro into fastpath 2012-07-24 11:27:05 -05:00
Jon Siwek
cfa8769a42 Fix memory leak when processing a thread's input message fails.
The message is reclaimed in both success/fail cases now.
2012-07-24 11:22:51 -05:00
Bernhard Amann
13952154a1 add comparator functor to the info maps of readerbackend and readerwriteend.
This is required, because after the recent changes the info map containst a
char* as key. Without the comparator the map will compare the char addresses
for all operations - which is not really what we want.
2012-07-24 09:19:20 -07:00
Jon Siwek
3f4b4c88a6 Fix initialization of WriterFrontend names.
The string representation of the writer looked up based on the stream's
enum value instead of the writer's enum value, often causing this
component of the name to be "(null)" since a null pointer was returned
from the lookup.
2012-07-24 11:18:32 -05:00
Robin Sommer
3f21764d00 Updating submodule(s).
[nomail]
2012-07-24 09:09:08 -07:00
Bernhard Amann
f887535f1c fix problem with possible access to unititialized memory
(thanks robin :) )
2012-07-23 17:28:27 -07:00
Robin Sommer
c6c2d4d5d6 Baseline update. 2012-07-23 16:59:51 -07:00
Robin Sommer
c2e0949484 Merge remote-tracking branch 'remotes/origin/topic/jsiwek/ascii-timestamp-fix'
* remotes/origin/topic/jsiwek/ascii-timestamp-fix:
  Fix WriterBackend::WriterInfo serialization, reenable ascii start/end tags.
2012-07-23 16:36:55 -07:00
Robin Sommer
5d33e22b4d Updating NEWS. 2012-07-23 16:27:34 -07:00
Robin Sommer
24aea295fa Merge branch 'topic/robin/master-test'
* topic/robin/master-test: (60 commits)
  Script fix for Linux.
  Updating test base line.
  Another small change to MsgThread API.
  Bug fix for BasicThread.
  make version_ok return true for TLSv12
  Sed usage in canonifier script didn't work on non-Linux systems.
  Changing HTTP DPD port 3138 to 3128.
  Temporarily removing tuning/logs-to-elasticsearch.bro from the test-all-policy.
  More documentation updates.
  Revert "Fixing calc_next_rotate to use UTC based time functions."
  Some documentation updates for elasticsearch plugin.
  Give configure a --disable-perftools option.
  Updating tests for the #start/#end change.
  Further threading and API restructuring for logging and input frameworks.
  Reworking forceful thread termination.
  Moving the ASCII writer over to use UNIX I/O rather than stdio.
  Further reworking the thread API.
  Reworking thread termination logic.
  If a thread doesn't terminate, we log that but not longer proceed (because it could hang later still).
  Removing the thread kill functionality.
  ...
2012-07-23 16:20:44 -07:00
Robin Sommer
b6991d405b Merge remote-tracking branch 'origin/fastpath' into topic/robin/master-test
* origin/fastpath:
  make version_ok return true for TLSv12
2012-07-23 15:46:04 -07:00
Jon Siwek
9b0fe744f2 Fix WriterBackend::WriterInfo serialization, reenable ascii start/end tags.
Instantiations of WriterInfo in RemoteSerializer::ProcessLogCreateWriter()
would leave the network_time member uninitialized which could later
cause localtime_r() calls in Ascii::Timestamp() to return a null pointer
due to the bizarre input and giving that to strftime() causes it to segfault.
2012-07-23 16:47:44 -05:00
Bernhard Amann
90735c3164 and just to be a little bit careful - add check if the field description is long enough.
Otherwise there might possibly be an access of uninitialized memory, when someone reads a file
that contains just #fields without any following field descriptions.
2012-07-23 12:51:07 -07:00