Commit graph

3375 commits

Author SHA1 Message Date
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
Bernhard Amann
3163e84629 and like nearly always - forgot the baseline. 2012-07-23 12:46:09 -07:00
Bernhard Amann
8e453663dd Input framework now accepts escaped ascii values as input.
I managed to completely forget to add unescaping to the input framework -
this should fix it. It now works with the exact same escaping that is
used by the writers (\x##).

Includes one testcase that seems to work - everything else still passes.
2012-07-23 12:43:42 -07:00
Bernhard Amann
336990e234 make reading ascii logfiles work when the input separator is different from \t.
(Wrong escape character was used for reading header fields).
2012-07-23 11:27:08 -07:00
Robin Sommer
f2e60a76a8 Script fix for Linux. 2012-07-22 21:04:59 -07:00
Robin Sommer
775961ee15 Updating test base line.
(Due to removing the debugging helper in canonification script.)
2012-07-22 15:57:26 -07:00
Robin Sommer
71fc2a1728 Another small change to MsgThread API.
Threads will now reliably get a call to DoFinish() no matter how the
thread terminates. This will always be called from within the thread,
whereas the destructor is called from the main thread after the child
thread has already terminated.

Also removing debugging code.

However, two problems remain with the ASCII writer (seeing them only
on MacOS):

    - the #start/#end timestamps contain only dummy values right now.
      The odd thing is that once I enable strftime() to print actual
      timestamps, I get crashes (even though strftime() is supposed to
      be thread-safe).

    - occassionally, there's still output missing in tests. In those
      cases, the file descriptor apparently goes bad: a write() will
      suddently return EBADF for reasons I don't understand yet.
2012-07-22 15:50:12 -07:00
Robin Sommer
053b307e24 Bug fix for BasicThread. 2012-07-22 13:42:31 -07:00
Bernhard Amann
642273bc58 Merge remote-tracking branch 'origin/fastpath' into fastpath 2012-07-20 14:37:53 -07:00
Bernhard Amann
58e2b70fc8 make version_ok return true for TLSv12
I think it is a bug that this was missing...
2012-07-20 14:37:14 -07:00
Bernhard Amann
d205eb8882 Merge remote-tracking branch 'origin/master' into fastpath 2012-07-20 14:26:23 -07:00
Robin Sommer
5ef83900d8 Sed usage in canonifier script didn't work on non-Linux systems. 2012-07-20 12:28:34 -07:00
Robin Sommer
ce4b8dd4ac Changing HTTP DPD port 3138 to 3128.
Addresses #857.
2012-07-20 09:57:38 -07:00
Robin Sommer
c5d1aebbfe Temporarily removing tuning/logs-to-elasticsearch.bro from the
test-all-policy.

Loading it in there can lead to some tests not terminating. We need to
fix that, it let's the coverage test fail.
2012-07-20 09:04:54 -07:00
Robin Sommer
6dc7a8b075 Merge remote-tracking branch 'origin/topic/seth/elasticsearch' into topic/robin/master-test
* origin/topic/seth/elasticsearch:
  More documentation updates.
2012-07-20 08:29:27 -07:00
Seth Hall
7bd8367076 More documentation updates. 2012-07-20 11:02:09 -04:00
Robin Sommer
eef8b7d1c4 Merge remote-tracking branch 'remotes/origin/topic/seth/elasticsearch' into topic/robin/master-test
I've only tested that it compiles, not whether it still works. The
fact that we don't have any tests for this makes me uneasy ...

* remotes/origin/topic/seth/elasticsearch: (35 commits)
  Some documentation updates for elasticsearch plugin.
  Temporarily removing the ES timeout because it works with signals and is incompatible with Bro threads.
  Changed ES index names to localtime and added a meta index.
  New script for easily duplicating logs to ElasticSearch.
  Some better elasticsearch reliability.
  Fixed small elasticsearch problem in configure output.
  Re-adding the needed call to FinishedRotation in the ES writer plugin.
  Tiny updates.
  Bringing elasticsearch branch up to date with master.
  Adding a define to make the stdint C macros available.
  Adding an extra header.
  Fixed a bug with messed up time value passing to elasticsearch.
  Small updates and a little standardization for config.h.in naming.
  Bug fixes.
  Bug fix and feature.
  Forgot to call the parent method for DoHeartBeat.
  Changed the escaping method.
  Flush logs to ES daemon as Bro is shutting down.
  Reduce the batch size to 1000 and add a maximum time interval for batches.
  Reworked bulk operation string construction to use ODesc and added json escaping.
  ...
2012-07-20 07:43:05 -07:00
Robin Sommer
147ddc779a Merge branch 'master' into topic/robin/master-test 2012-07-20 07:05:10 -07:00
Robin Sommer
2efebcd8be Updating submodule(s).
[nomail]
2012-07-20 07:04:37 -07:00
Robin Sommer
bdbc0a0d60 Merge remote-tracking branch 'origin/fastpath' into topic/robin/master-test
* origin/fastpath:
  Revert "Fixing calc_next_rotate to use UTC based time functions."
  Fixing calc_next_rotate to use UTC based time functions.
2012-07-20 06:59:39 -07:00
Robin Sommer
0a681367b7 Revert "Fixing calc_next_rotate to use UTC based time functions."
This reverts commit 6335dbb5e1.
2012-07-20 06:58:39 -07:00
Robin Sommer
450b49d14d Merge branch 'fastpath' of ssh://git.bro-ids.org/bro into fastpath 2012-07-20 06:58:33 -07:00
Seth Hall
db3d89d290 Some documentation updates for elasticsearch plugin. 2012-07-20 08:51:39 -04:00
Robin Sommer
7fde1165e9 Give configure a --disable-perftools option.
This disables Perftools support even if found. Linking in tcmalloc can
make debugging memory problems quite a bit hard (including confusing
valgrind).
2012-07-19 22:28:55 -07:00
Robin Sommer
5cfb8d65c3 Updating tests for the #start/#end change. 2012-07-19 22:28:55 -07:00
Robin Sommer
87e10b5f97 Further threading and API restructuring for logging and input
frameworks.

There were a number of cases that weren't thread-safe. In particular,
we don't use std::string anymore for anything that's passed between
threads (but instead plain old const char*, with manual memmory
managmenet).

This is still a check-point commit, I'll do more testing.
2012-07-19 22:28:30 -07:00
Robin Sommer
490859cfef Reworking forceful thread termination.
Ctrl-C now kills a thread even if it hangs at termination. And readded
a (rather long) timeout to kill threads automatically that don't
shutdown.
2012-07-19 21:22:28 -07:00