Commit graph

6667 commits

Author SHA1 Message Date
Bernhard Amann
381adb2a1e temporary osx mavericks libc++ issue workaround.
When using clang3.3 on mavericks with libc++, after the
first std::getline-call encountered eof on an ifstream,
all following std::getline calls on the same ifstream will
also get eof, even if ifstream::clear has been called and
the file has been appended in the meantime.

Seeking to the current position after a clear before trying
to read the line fixes this behavior.

This is just a temporary workaround...
2013-10-24 12:26:26 -07:00
Robin Sommer
08e6b6b4b4 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix record coercion tolerance of optional fields.
  Add NEWS about incompatible local.bro changes, addresses BIT-1047.
  Fix minor formatting problem in NEWS.
2013-10-23 09:50:47 -07:00
Jon Siwek
7e95755ce5 Fix record coercion tolerance of optional fields.
There were cases where coercing a record value with an uninitialized
field could cause a null pointer dereference even though the field
can validly be unset since it has &optional.
2013-10-23 11:37:23 -05:00
Jon Siwek
52733b0501 Quick optimization to Broxygen doc gathering.
So script parsing is only ~2x slower rather than 20x.  Turns out cloning
Vals is particularly slow.  Changed to just get a string description of
the Val for initial value and redef tracking.
2013-10-22 16:29:58 -05:00
Jon Siwek
15b1904ca8 Merge branch 'master' into topic/jsiwek/broxygen 2013-10-22 14:48:24 -05:00
Jon Siwek
f18436640e Flesh out Broxygen doc-gathering skeleton. 2013-10-22 14:45:47 -05:00
Daniel Thayer
bb14a44c2f Make RFC links in the docs more consistent 2013-10-22 12:08:19 -05:00
Daniel Thayer
9cfedccf37 Fix typos and formatting in the events docs 2013-10-21 16:50:14 -05:00
Daniel Thayer
023ea4b588 Fix formatting in the protocol BiFs docs 2013-10-18 19:36:37 -05:00
Robin Sommer
615cca8baa Merge remote-tracking branch 'origin/topic/dnthayer/doc-changes-for-2.2'
Snapshotting the work in this branch. I'll merge it again later as we
get closer to the release.

* origin/topic/dnthayer/doc-changes-for-2.2: (29 commits)
  Add README files for base/protocols
  Fix incorrect uses of reST directives
  Fix typos and formatting in the BiFs docs
  Fix typos and formatting in the base/utils docs
  Fix typos and formatting in the other protocol docs
  Fix typos and formatting in the ssl protocol docs
  Fix typos and formatting in the http protocol docs
  Fix typos and formatting in the ftp protocol docs
  Fix typos and formatting in the dns protocol docs
  Fix typos and formatting in the dhcp protocol docs
  Adjust line numbers to match changes in conn/main.bro
  Fix typos and formatting in the conn protocol docs
  Update FreeBSD install instructions
  Improvements to file analysis docs
  Add README files for most Bro frameworks
  Fix typos and formatting in various other framework docs
  Fix typos and formatting in the software framework docs
  Fix typos and formatting in the sumstats docs
  Fix typos and formatting in the packet filter docs
  Fix typos and formatting in the logging framework docs
  ...
2013-10-18 13:49:49 -07:00
Bernhard Amann
4aa363b0d2 add check that the SQLite reader is only used in MANUAL reading mode 2013-10-17 14:47:15 -07:00
Bernhard Amann
363cfb8506 rename the dbname configuration option to tablename.
Sorry for this - I noticed that I named this option quite unfortunately
while writing the documentation.

The patch also removes the dbname configuration option from the sqlite
input reader - it was not used there at all anymore (and I did not notice
that).
2013-10-17 12:24:40 -07:00
Daniel Thayer
8c3adc9df6 Fix typos and formatting in the BiFs docs 2013-10-17 01:04:20 -05:00
Jon Siwek
47d7d9047b Merge branch 'master' into topic/jsiwek/broxygen 2013-10-16 13:34:14 -05:00
Daniel Thayer
f0f1918954 Merge remote-tracking branch 'origin/master' into topic/dnthayer/doc-changes-for-2.2 2013-10-14 17:26:52 -05:00
Jon Siwek
cf6d7ba5ae Fix more Coverity-reported issues (introduced by internal error audit).
Mem leaks and a null pointer deref (not actually expected to occur
unless already in one of the the odd states that warrants an internal
warning/error).

Also dead code.
2013-10-14 15:37:45 -05:00
Jon Siwek
38ae7c98b4 Fix misc. issues reported by Coverity.
Some uninitialized values, a possible null pointer dereference, and
time-of-check-time-of-use on reading random seed file.
2013-10-14 14:02:39 -05:00
Robin Sommer
e5ad3c38c9 Merge branch 'topic/robin/internal-errors-merge'
* topic/robin/internal-errors-merge:
  Reverting one of the my internal errors tweaks.
  Renaming InternalAnalyzerError to AnalyzerError.
  Pass over the InternalError() changes.
  Review usage of Reporter::InternalError, addresses BIT-1045.
2013-10-14 09:21:05 -07:00
Robin Sommer
2a87a70884 Reverting one of the my internal errors tweaks. 2013-10-14 09:19:19 -07:00
Daniel Thayer
93c1073673 Merge remote-tracking branch 'origin/master' into topic/dnthayer/doc-changes-for-2.2 2013-10-11 23:16:57 -05:00
Robin Sommer
1a9835a00a Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Improve Broxygen end-of-sentence detection.
2013-10-11 17:23:41 -07:00
Robin Sommer
8e18f9d59e Renaming InternalAnalyzerError to AnalyzerError.
This is to avoid confusion when we abort and when not: InternalError()
aborts; AnalyzerError() does not.
2013-10-11 15:14:18 -07:00
Robin Sommer
d6855dc4eb Pass over the InternalError() changes. 2013-10-11 15:11:06 -07:00
Daniel Thayer
b5af589246 Improvements to file analysis docs
Fixed reference to wrong field name.
Added documentation of a function arg.
Added a couple references to other parts of the documentation.
Explained how not specifying extraction filename results in automatic
filename generation.
Several other minor clarifications.
2013-10-11 16:31:53 -05:00
Jon Siwek
ee01a67e06 Improve Broxygen end-of-sentence detection.
This is used to display short summaries for things based on the first
sentence in the comments for it, but wouldn't work well when e.g. a
filename is used there.
2013-10-11 13:27:04 -05:00
Jon Siwek
f358f8b374 Merge branch 'master' into topic/jsiwek/internal-errors 2013-10-10 14:58:28 -05:00
Jon Siwek
b828a6ddc7 Review usage of Reporter::InternalError, addresses BIT-1045.
Replaced some with InternalWarning or InternalAnalyzerError, the later
being a new method which signals the analyzer to not process further
input.  Some usages I just removed if they didn't make sense or clearly
couldn't happen.  Also did some minor refactors of related code while
reviewing/exploring ways to get rid of InternalError usages.

Also, for TCP content file write failures there's a new event:
"contents_file_write_failure".
2013-10-10 14:45:06 -05:00
Robin Sommer
0fe474e232 Polishing the reference section of the manual.
Mostly resorting and renaming a few things.
2013-10-07 15:53:46 -07:00
Jon Siwek
90477df973 Refactor search_for_file() util function.
It was getting too bloated and allocated memory in ways that were
difficult to understand how to manage.  Separated out primarily in to
new find_file() and open_file()/open_package() functions.

Also renamed other util functions for path-related things.
2013-10-07 15:01:03 -05:00
Jon Siwek
68227f112d Merge branch 'master' into topic/jsiwek/broxygen 2013-10-03 13:06:23 -05:00
Jon Siwek
5a857a6dfc Initial skeleton of new Broxygen infrastructure.
Doesn't generate any docs, but it's hooked in to all places needed to
gather the necessary stuff w/ significantly less coupling than before.

The gathering now always occurs unconditionally to make documentation
available at runtime and a command line switch (-X) only toggles whether
to output docs to disk (reST format).

Should also improve the treatment of type name aliasing which wasn't a
big problem in practice before, but I think it's more correct now:
there's now a distinct BroType for each alias, but extensible types
(record/enum) will automatically update the types for aliases on redef.

Other misc refactoring of note:

    - Removed a redundant/unused way of declaring event types.

    - Changed type serialization format/process to preserve type name
      information and remove compatibility code (since broccoli will
      have be updated anyway).
2013-10-03 10:42:04 -05:00
Robin Sommer
6734260136 Fixing merge relict. 2013-10-02 11:32:53 -07:00
Robin Sommer
d127d8d01d Merge remote-tracking branch 'origin/topic/jsiwek/coverity'
* origin/topic/jsiwek/coverity:
  Fix uninitialized (or unused) fields.
  Remove logically dead code.
  Remove dead/unfinished code in unary not expr.
  Fix logic for failed DNS TXT lookups.
  A couple null ptr checks.
  Improve return value checking and error handling.
  Remove unused variable assignments, dead code.
  Prevent division/modulo by zero in scripts.
  Fix unintentional always-false condition.
  Fix invalidated iterator usage.
  Fix DNS_Mgr iterator mismatch.
  Set safe umask when creating script profiler tmp files.
  Fix nesting/indent level whitespace mismatch.
  Add checks to avoid improper negative values use.

BIT-1085 #merged
2013-10-02 11:05:49 -07:00
Bernhard Amann
2b87499fd9 rip out x509 code from ssl analyzer. Note that since at the moment
the file analyzer does not yet re-populate the info record that
means quite a lot of information is simply not available.
2013-10-01 16:25:33 -07:00
Robin Sommer
6c8cbef997 Updating bifcl usage message. 2013-10-01 11:32:37 -07:00
Jon Siwek
9450515821 Fix getopt() usage.
Using 'char' versus 'int' to store the return value is a problem since
'char' varies in signedness depending on platform/implementation
(works some places, others not).
2013-10-01 13:11:35 -05:00
Jon Siwek
775ec6795e Fix uninitialized (or unused) fields. 2013-09-27 10:13:52 -05:00
Jon Siwek
64f3bef96d Remove logically dead code. 2013-09-25 13:37:46 -05:00
Jon Siwek
4072afb363 Remove dead/unfinished code in unary not expr.
The code that looks like it was intended to make it apply to a vector
operand couldn't be reached and making it reachable would still require
changes to other methods for it to work so just removing for now.
2013-09-25 12:49:46 -05:00
Jon Siwek
2203600e05 Fix logic for failed DNS TXT lookups.
A failed request should not evict a previous result from the local
cache/mapping.
2013-09-25 12:04:07 -05:00
Jon Siwek
3c37e818ce A couple null ptr checks. 2013-09-25 11:16:46 -05:00
Jon Siwek
daf5d0d098 Improve return value checking and error handling. 2013-09-24 17:38:22 -05:00
Jon Siwek
e4e7c78925 Remove unused variable assignments, dead code. 2013-09-23 16:57:31 -05:00
Jon Siwek
9c2a3124e0 Merge branch 'master' into topic/jsiwek/coverity 2013-09-23 14:55:46 -05:00
Robin Sommer
601cdbc6cf Fixing an always false condition.
Reported by clang.
2013-09-23 11:48:56 -07:00
Robin Sommer
09b7ccba23 Fix required for compiling with clang 3.3. 2013-09-23 11:48:38 -07:00
Jon Siwek
1750e351c4 Prevent division/modulo by zero in scripts.
Integral/floating-point division/modulo by zero in C++ is undefined
behavior, so to prevent such cases in a script from crashing Bro,
they're now reported as an error (with script location information) and
the event handler in which it occurred returns immediately.
2013-09-20 16:36:00 -05:00
Robin Sommer
97cb04aae2 Merge remote-tracking branch 'origin/topic/jsiwek/raw-exec-pgrp'
* origin/topic/jsiwek/raw-exec-pgrp:
  Kill raw input reader's child by process group.

BIT-1081 #merged
2013-09-20 14:12:59 -07:00
Jon Siwek
4e2e690bff Fix unintentional always-false condition. 2013-09-20 14:21:03 -05:00
Jon Siwek
9033b0384b Fix invalidated iterator usage. 2013-09-20 12:11:10 -05:00