Merge remote-tracking branch 'origin/master' into topic/seth/elasticsearch

This commit is contained in:
Seth Hall 2012-07-10 20:32:42 -04:00
commit 728888ad45
17 changed files with 29 additions and 21 deletions

10
CHANGES
View file

@ -1,5 +1,13 @@
2.1-beta | 2012-07-06 07:36:29 -0700 2.0-755 | 2012-07-10 16:25:16 -0700
* Add sorting canonifier to rotate-custom unit test. Addresses #846.
(Jon Siwek)
* Fix many compiler warnings. (Daniel Thayer)
* Fix segfault when there's an error/timeout resolving DNS requests.
Addresses #846. (Jon Siwek)
* Remove a non-portable test case. (Daniel Thayer) * Remove a non-portable test case. (Daniel Thayer)

View file

@ -1 +1 @@
2.1-beta 2.0-755

@ -1 +1 @@
Subproject commit bd9d698f708908f7258211b534c91467d486983b Subproject commit 8234b8903cbc775f341bdb6a1c0159981d88d27b

@ -1 +1 @@
Subproject commit 6bfc0bfae0406deddf207475582bf7a17f1787af Subproject commit d5ecd1a42c04b0dca332edc31811e5a6d0f7f2fb

View file

@ -693,7 +693,7 @@ Val* DNS_Mgr::BuildMappingVal(DNS_Mapping* dm)
void DNS_Mgr::AddResult(DNS_Mgr_Request* dr, struct nb_dns_result* r) void DNS_Mgr::AddResult(DNS_Mgr_Request* dr, struct nb_dns_result* r)
{ {
struct hostent* h = (r && r->host_errno == 0) ? r->hostent : 0; struct hostent* h = (r && r->host_errno == 0) ? r->hostent : 0;
u_int32_t ttl = r->ttl; u_int32_t ttl = (r && r->host_errno == 0) ? r->ttl : 0;
DNS_Mapping* new_dm; DNS_Mapping* new_dm;
DNS_Mapping* prev_dm; DNS_Mapping* prev_dm;

View file

@ -96,7 +96,7 @@ EventHandler* EventHandler::Unserialize(UnserialInfo* info)
{ {
char* name; char* name;
if ( ! UNSERIALIZE_STR(&name, 0) ) if ( ! UNSERIALIZE_STR(&name, 0) )
return false; return 0;
EventHandler* h = event_registry->Lookup(name); EventHandler* h = event_registry->Lookup(name);
if ( ! h ) if ( ! h )

View file

@ -100,7 +100,7 @@ Func* Func::Unserialize(UnserialInfo* info)
if ( ! (id->HasVal() && id->ID_Val()->Type()->Tag() == TYPE_FUNC) ) if ( ! (id->HasVal() && id->ID_Val()->Type()->Tag() == TYPE_FUNC) )
{ {
info->s->Error(fmt("ID %s is not a built-in", name)); info->s->Error(fmt("ID %s is not a built-in", name));
return false; return 0;
} }
Unref(f); Unref(f);

View file

@ -17,8 +17,8 @@
class IncrementalSendTimer; class IncrementalSendTimer;
namespace threading { namespace threading {
class Field; struct Field;
class Value; struct Value;
} }
// This class handles the communication done in Bro's main loop. // This class handles the communication done in Bro's main loop.

View file

@ -368,7 +368,7 @@ int SMB_Session::ParseSetupAndx(int is_orig, binpac::SMB::SMB_header const& hdr,
// The binpac type depends on the negotiated server settings - // The binpac type depends on the negotiated server settings -
// possibly we can just pick the "right" format here, and use that? // possibly we can just pick the "right" format here, and use that?
if ( hdr.flags2() && 0x0800 ) if ( hdr.flags2() & 0x0800 )
{ {
binpac::SMB::SMB_setup_andx_ext msg(hdr.unicode()); binpac::SMB::SMB_setup_andx_ext msg(hdr.unicode());
msg.Parse(body.data(), body.data() + body.length()); msg.Parse(body.data(), body.data() + body.length());

View file

@ -163,7 +163,7 @@ SerialObj* SerialObj::Unserialize(UnserialInfo* info, SerialType type)
if ( ! result ) if ( ! result )
{ {
DBG_POP(DBG_SERIAL); DBG_POP(DBG_SERIAL);
return false; return 0;
} }
DBG_POP(DBG_SERIAL); DBG_POP(DBG_SERIAL);

View file

@ -18,9 +18,9 @@ struct pcap_pkthdr;
class EncapsulationStack; class EncapsulationStack;
class Connection; class Connection;
class ConnID;
class OSFingerprint; class OSFingerprint;
class ConnCompressor; class ConnCompressor;
struct ConnID;
declare(PDict,Connection); declare(PDict,Connection);
declare(PDict,FragReassembler); declare(PDict,FragReassembler);

View file

@ -910,7 +910,7 @@ Val* RecordType::FieldDefault(int field) const
const TypeDecl* td = FieldDecl(field); const TypeDecl* td = FieldDecl(field);
if ( ! td->attrs ) if ( ! td->attrs )
return false; return 0;
const Attr* def_attr = td->attrs->FindAttr(ATTR_DEFAULT); const Attr* def_attr = td->attrs->FindAttr(ATTR_DEFAULT);

View file

@ -232,7 +232,7 @@ Value* Ascii::EntryToVal(string s, FieldMapping field)
{ {
Error(Fmt("Field: %s Invalid value for boolean: %s", Error(Fmt("Field: %s Invalid value for boolean: %s",
field.name.c_str(), s.c_str())); field.name.c_str(), s.c_str()));
return false; return 0;
} }
break; break;
@ -262,7 +262,7 @@ Value* Ascii::EntryToVal(string s, FieldMapping field)
if ( pos == s.npos ) if ( pos == s.npos )
{ {
Error(Fmt("Invalid value for subnet: %s", s.c_str())); Error(Fmt("Invalid value for subnet: %s", s.c_str()));
return false; return 0;
} }
int width = atoi(s.substr(pos+1).c_str()); int width = atoi(s.substr(pos+1).c_str());

View file

@ -992,7 +992,7 @@ WriterFrontend* Manager::CreateWriter(EnumVal* id, EnumVal* writer, const Writer
if ( ! stream ) if ( ! stream )
// Don't know this stream. // Don't know this stream.
return false; return 0;
Stream::WriterMap::iterator w = Stream::WriterMap::iterator w =
stream->writers.find(Stream::WriterPathPair(writer->AsEnum(), info.path)); stream->writers.find(Stream::WriterPathPair(writer->AsEnum(), info.path));

View file

@ -295,7 +295,7 @@ refine connection SSL_Conn += {
for ( int k = 0; k < num_ext; ++k ) for ( int k = 0; k < num_ext; ++k )
{ {
unsigned char *pBuffer = 0; unsigned char *pBuffer = 0;
uint length = 0; int length = 0;
X509_EXTENSION* ex = X509_get_ext(pTemp, k); X509_EXTENSION* ex = X509_get_ext(pTemp, k);
if (ex) if (ex)
@ -303,7 +303,7 @@ refine connection SSL_Conn += {
ASN1_STRING *pString = X509_EXTENSION_get_data(ex); ASN1_STRING *pString = X509_EXTENSION_get_data(ex);
length = ASN1_STRING_to_UTF8(&pBuffer, pString); length = ASN1_STRING_to_UTF8(&pBuffer, pString);
//i2t_ASN1_OBJECT(&pBuffer, length, obj) //i2t_ASN1_OBJECT(&pBuffer, length, obj)
// printf("extension length: %u\n", length); // printf("extension length: %d\n", length);
// -1 indicates an error. // -1 indicates an error.
if ( length < 0 ) if ( length < 0 )
continue; continue;

View file

@ -2,8 +2,6 @@
#ifndef THREADING_SERIALIZATIONTYPES_H #ifndef THREADING_SERIALIZATIONTYPES_H
#define THREADING_SERIALIZATIONTYPES_H #define THREADING_SERIALIZATIONTYPES_H
using namespace std;
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
@ -11,6 +9,8 @@ using namespace std;
#include "Type.h" #include "Type.h"
#include "net_util.h" #include "net_util.h"
using namespace std;
class SerializationFormat; class SerializationFormat;
namespace threading { namespace threading {

View file

@ -2,7 +2,7 @@
#@TEST-EXEC: bro -b -r ${TRACES}/rotation.trace %INPUT | egrep "test|test2" | sort >out #@TEST-EXEC: bro -b -r ${TRACES}/rotation.trace %INPUT | egrep "test|test2" | sort >out
# @TEST-EXEC: for i in `ls test*.log | sort`; do printf '> %s\n' $i; cat $i; done | sort | uniq >>out # @TEST-EXEC: for i in `ls test*.log | sort`; do printf '> %s\n' $i; cat $i; done | sort | uniq >>out
# @TEST-EXEC: btest-diff out # @TEST-EXEC: btest-diff out
# @TEST-EXEC: btest-diff .stderr # @TEST-EXEC: TEST_DIFF_CANONIFIER=$SCRIPTS/diff-sort btest-diff .stderr
module Test; module Test;