From cec4600d2e16aadb9d24954f562f55edb0398a3d Mon Sep 17 00:00:00 2001 From: Jon Siwek Date: Tue, 1 Nov 2011 14:44:38 -0500 Subject: [PATCH 1/9] Fixing compiler warnings (addresses #388) --- src/Base64.h | 2 +- src/CompHash.cc | 2 +- src/Debug.cc | 2 +- src/Desc.cc | 2 +- src/File.cc | 18 +++++++++--------- src/FileAnalyzer.cc | 4 ++-- src/LogMgr.cc | 2 +- src/OSFinger.cc | 6 +++--- src/PolicyFile.cc | 3 ++- src/RemoteSerializer.cc | 28 ++++++++++++++-------------- src/SerialObj.cc | 4 ++-- src/StateAccess.cc | 4 ++-- src/bro.bif | 8 ++++---- src/scan.l | 2 +- src/util.cc | 20 ++++++++++---------- 15 files changed, 54 insertions(+), 53 deletions(-) diff --git a/src/Base64.h b/src/Base64.h index 0fe7e04910..7f351a2c2b 100644 --- a/src/Base64.h +++ b/src/Base64.h @@ -44,7 +44,7 @@ public: if ( analyzer ) analyzer->Weird("base64_illegal_encoding", msg); else - reporter->Error(msg); + reporter->Error("%s", msg); } protected: diff --git a/src/CompHash.cc b/src/CompHash.cc index 6893cafd8f..148c8384ee 100644 --- a/src/CompHash.cc +++ b/src/CompHash.cc @@ -522,7 +522,7 @@ ListVal* CompositeHash::RecoverVals(const HashKey* k) const } if ( kp != k_end ) - reporter->InternalError("under-ran key in CompositeHash::DescribeKey %ld", k_end - kp); + reporter->InternalError("under-ran key in CompositeHash::DescribeKey %zd", k_end - kp); return l; } diff --git a/src/Debug.cc b/src/Debug.cc index 3aa805d5bf..1b849fff7e 100644 --- a/src/Debug.cc +++ b/src/Debug.cc @@ -797,7 +797,7 @@ int dbg_handle_debug_input() input_line = (char*) safe_malloc(1024); input_line[1023] = 0; // ### Maybe it's not always stdin. - fgets(input_line, 1023, stdin); + input_line = fgets(input_line, 1023, stdin); #endif // ### Maybe not stdin; maybe do better cleanup. diff --git a/src/Desc.cc b/src/Desc.cc index 7121253087..745b7c5efa 100644 --- a/src/Desc.cc +++ b/src/Desc.cc @@ -296,7 +296,7 @@ void ODesc::AddBytesRaw(const void* bytes, unsigned int n) if ( ! write_failed ) // Most likely it's a "disk full" so report // subsequent failures only once. - reporter->Error(fmt("error writing to %s: %s", f->Name(), strerror(errno))); + reporter->Error("%s", fmt("error writing to %s: %s", f->Name(), strerror(errno))); write_failed = true; return; diff --git a/src/File.cc b/src/File.cc index 37ce7c0b4b..cd8c635504 100644 --- a/src/File.cc +++ b/src/File.cc @@ -149,7 +149,7 @@ BroFile::BroFile(const char* arg_name, const char* arg_access, BroType* arg_t) t = arg_t ? arg_t : base_type(TYPE_STRING); if ( ! Open() ) { - reporter->Error(fmt("cannot open %s: %s", name, strerror(errno))); + reporter->Error("%s", fmt("cannot open %s: %s", name, strerror(errno))); is_open = 0; okay_to_manage = 0; } @@ -641,7 +641,7 @@ void BroFile::InitEncrypt(const char* keyfile) if ( ! key ) { - reporter->Error(fmt("can't open key file %s: %s", keyfile, strerror(errno))); + reporter->Error("%s", fmt("can't open key file %s: %s", keyfile, strerror(errno))); Close(); return; } @@ -649,7 +649,7 @@ void BroFile::InitEncrypt(const char* keyfile) pub_key = PEM_read_PUBKEY(key, 0, 0, 0); if ( ! pub_key ) { - reporter->Error(fmt("can't read key from %s: %s", keyfile, + reporter->Error("%s", fmt("can't read key from %s: %s", keyfile, ERR_error_string(ERR_get_error(), 0))); Close(); return; @@ -671,7 +671,7 @@ void BroFile::InitEncrypt(const char* keyfile) if ( ! EVP_SealInit(cipher_ctx, cipher_type, &psecret, (int*) &secret_len, iv, &pub_key, 1) ) { - reporter->Error(fmt("can't init cipher context for %s: %s", keyfile, + reporter->Error("%s", fmt("can't init cipher context for %s: %s", keyfile, ERR_error_string(ERR_get_error(), 0))); Close(); return; @@ -684,7 +684,7 @@ void BroFile::InitEncrypt(const char* keyfile) fwrite(secret, ntohl(secret_len), 1, f) && fwrite(iv, iv_len, 1, f)) ) { - reporter->Error(fmt("can't write header to log file %s: %s", + reporter->Error("%s", fmt("can't write header to log file %s: %s", name, strerror(errno))); Close(); return; @@ -709,7 +709,7 @@ void BroFile::FinishEncrypt() if ( outl && ! fwrite(cipher_buffer, outl, 1, f) ) { - reporter->Error(fmt("write error for %s: %s", + reporter->Error("%s", fmt("write error for %s: %s", name, strerror(errno))); return; } @@ -741,7 +741,7 @@ int BroFile::Write(const char* data, int len) if ( ! EVP_SealUpdate(cipher_ctx, cipher_buffer, &outl, (unsigned char*)data, inl) ) { - reporter->Error(fmt("encryption error for %s: %s", + reporter->Error("%s", fmt("encryption error for %s: %s", name, ERR_error_string(ERR_get_error(), 0))); Close(); @@ -750,7 +750,7 @@ int BroFile::Write(const char* data, int len) if ( outl && ! fwrite(cipher_buffer, outl, 1, f) ) { - reporter->Error(fmt("write error for %s: %s", + reporter->Error("%s", fmt("write error for %s: %s", name, strerror(errno))); Close(); return 0; @@ -798,7 +798,7 @@ void BroFile::UpdateFileSize() struct stat s; if ( fstat(fileno(f), &s) < 0 ) { - reporter->Error(fmt("can't stat fd for %s: %s", name, strerror(errno))); + reporter->Error("%s", fmt("can't stat fd for %s: %s", name, strerror(errno))); current_size = 0; return; } diff --git a/src/FileAnalyzer.cc b/src/FileAnalyzer.cc index 1abe88caec..fc1ac0563c 100644 --- a/src/FileAnalyzer.cc +++ b/src/FileAnalyzer.cc @@ -74,11 +74,11 @@ void File_Analyzer::InitMagic(magic_t* magic, int flags) *magic = magic_open(flags); if ( ! *magic ) - reporter->Error(fmt("can't init libmagic: %s", magic_error(*magic))); + reporter->Error("%s", fmt("can't init libmagic: %s", magic_error(*magic))); else if ( magic_load(*magic, 0) < 0 ) { - reporter->Error(fmt("can't load magic file: %s", magic_error(*magic))); + reporter->Error("%s", fmt("can't load magic file: %s", magic_error(*magic))); magic_close(*magic); *magic = 0; } diff --git a/src/LogMgr.cc b/src/LogMgr.cc index 9e320f8810..16c82a4646 100644 --- a/src/LogMgr.cc +++ b/src/LogMgr.cc @@ -1453,7 +1453,7 @@ bool LogMgr::Flush(EnumVal* id) void LogMgr::Error(LogWriter* writer, const char* msg) { - reporter->Error(fmt("error with writer for %s: %s", + reporter->Error("%s", fmt("error with writer for %s: %s", writer->Path().c_str(), msg)); } diff --git a/src/OSFinger.cc b/src/OSFinger.cc index 70504e8422..e23e3044ec 100644 --- a/src/OSFinger.cc +++ b/src/OSFinger.cc @@ -85,7 +85,7 @@ void OSFingerprint::collide(uint32 id) if (sig[id].ttl % 32 && sig[id].ttl != 255 && sig[id].ttl % 30) { problems=1; - reporter->Warning(fmt("OS fingerprinting: [!] Unusual TTL (%d) for signature '%s %s' (line %d).", + reporter->Warning("%s", fmt("OS fingerprinting: [!] Unusual TTL (%d) for signature '%s %s' (line %d).", sig[id].ttl,sig[id].os,sig[id].desc,sig[id].line)); } @@ -94,7 +94,7 @@ void OSFingerprint::collide(uint32 id) if (!strcmp(sig[i].os,sig[id].os) && !strcmp(sig[i].desc,sig[id].desc)) { problems=1; - reporter->Warning(fmt("OS fingerprinting: [!] Duplicate signature name: '%s %s' (line %d and %d).", + reporter->Warning("%s", fmt("OS fingerprinting: [!] Duplicate signature name: '%s %s' (line %d and %d).", sig[i].os,sig[i].desc,sig[i].line,sig[id].line)); } @@ -277,7 +277,7 @@ do_const: if (sig[id].opt[j] ^ sig[i].opt[j]) goto reloop; problems=1; - reporter->Warning(fmt("OS fingerprinting: [!] Signature '%s %s' (line %d)\n" + reporter->Warning("%s", fmt("OS fingerprinting: [!] Signature '%s %s' (line %d)\n" " is already covered by '%s %s' (line %d).", sig[id].os,sig[id].desc,sig[id].line,sig[i].os,sig[i].desc, sig[i].line)); diff --git a/src/PolicyFile.cc b/src/PolicyFile.cc index 53b115048a..9f67ee88a1 100644 --- a/src/PolicyFile.cc +++ b/src/PolicyFile.cc @@ -88,7 +88,8 @@ bool LoadPolicyFileText(const char* policy_filename) // ### This code is not necessarily Unicode safe! // (probably fine with UTF-8) pf->filedata = new char[size+1]; - fread(pf->filedata, size, 1, f); + if ( fread(pf->filedata, size, 1, f) != 1 ) + reporter->InternalError("Failed to fread() file data"); pf->filedata[size] = 0; fclose(f); diff --git a/src/RemoteSerializer.cc b/src/RemoteSerializer.cc index 03588429de..a841930562 100644 --- a/src/RemoteSerializer.cc +++ b/src/RemoteSerializer.cc @@ -392,7 +392,7 @@ static bool sendToIO(ChunkedIO* io, ChunkedIO::Chunk* c) { if ( ! io->Write(c) ) { - reporter->Warning(fmt("can't send chunk: %s", io->Error())); + reporter->Warning("%s", fmt("can't send chunk: %s", io->Error())); return false; } @@ -404,7 +404,7 @@ static bool sendToIO(ChunkedIO* io, char msg_type, RemoteSerializer::PeerID id, { if ( ! sendCMsg(io, msg_type, id) ) { - reporter->Warning(fmt("can't send message of type %d: %s", msg_type, io->Error())); + reporter->Warning("%s", fmt("can't send message of type %d: %s", msg_type, io->Error())); return false; } @@ -419,7 +419,7 @@ static bool sendToIO(ChunkedIO* io, char msg_type, RemoteSerializer::PeerID id, { if ( ! sendCMsg(io, msg_type, id) ) { - reporter->Warning(fmt("can't send message of type %d: %s", msg_type, io->Error())); + reporter->Warning("%s", fmt("can't send message of type %d: %s", msg_type, io->Error())); return false; } @@ -715,7 +715,7 @@ bool RemoteSerializer::CloseConnection(PeerID id) Peer* peer = LookupPeer(id, true); if ( ! peer ) { - reporter->Error(fmt("unknown peer id %d for closing connection", int(id))); + reporter->Error("%s", fmt("unknown peer id %d for closing connection", int(id))); return false; } @@ -750,13 +750,13 @@ bool RemoteSerializer::RequestSync(PeerID id, bool auth) Peer* peer = LookupPeer(id, true); if ( ! peer ) { - reporter->Error(fmt("unknown peer id %d for request sync", int(id))); + reporter->Error("%s", fmt("unknown peer id %d for request sync", int(id))); return false; } if ( peer->phase != Peer::HANDSHAKE ) { - reporter->Error(fmt("can't request sync from peer; wrong phase %d", + reporter->Error("%s", fmt("can't request sync from peer; wrong phase %d", peer->phase)); return false; } @@ -777,13 +777,13 @@ bool RemoteSerializer::RequestLogs(PeerID id) Peer* peer = LookupPeer(id, true); if ( ! peer ) { - reporter->Error(fmt("unknown peer id %d for request logs", int(id))); + reporter->Error("%s", fmt("unknown peer id %d for request logs", int(id))); return false; } if ( peer->phase != Peer::HANDSHAKE ) { - reporter->Error(fmt("can't request logs from peer; wrong phase %d", + reporter->Error("%s", fmt("can't request logs from peer; wrong phase %d", peer->phase)); return false; } @@ -802,13 +802,13 @@ bool RemoteSerializer::RequestEvents(PeerID id, RE_Matcher* pattern) Peer* peer = LookupPeer(id, true); if ( ! peer ) { - reporter->Error(fmt("unknown peer id %d for request sync", int(id))); + reporter->Error("%s", fmt("unknown peer id %d for request sync", int(id))); return false; } if ( peer->phase != Peer::HANDSHAKE ) { - reporter->Error(fmt("can't request events from peer; wrong phase %d", + reporter->Error("%s", fmt("can't request events from peer; wrong phase %d", peer->phase)); return false; } @@ -869,7 +869,7 @@ bool RemoteSerializer::CompleteHandshake(PeerID id) if ( p->phase != Peer::HANDSHAKE ) { - reporter->Error(fmt("can't complete handshake; wrong phase %d", + reporter->Error("%s", fmt("can't complete handshake; wrong phase %d", p->phase)); return false; } @@ -1138,7 +1138,7 @@ bool RemoteSerializer::SendCaptureFilter(PeerID id, const char* filter) if ( peer->phase != Peer::HANDSHAKE ) { - reporter->Error(fmt("can't sent capture filter to peer; wrong phase %d", peer->phase)); + reporter->Error("%s", fmt("can't sent capture filter to peer; wrong phase %d", peer->phase)); return false; } @@ -1215,7 +1215,7 @@ bool RemoteSerializer::SendCapabilities(Peer* peer) { if ( peer->phase != Peer::HANDSHAKE ) { - reporter->Error(fmt("can't sent capabilties to peer; wrong phase %d", + reporter->Error("%s", fmt("can't sent capabilties to peer; wrong phase %d", peer->phase)); return false; } @@ -3011,7 +3011,7 @@ bool RemoteSerializer::SendCMsgToChild(char msg_type, Peer* peer) { if ( ! sendCMsg(io, msg_type, peer ? peer->id : PEER_NONE) ) { - reporter->Warning(fmt("can't send message of type %d: %s", + reporter->Warning("%s", fmt("can't send message of type %d: %s", msg_type, io->Error())); return false; } diff --git a/src/SerialObj.cc b/src/SerialObj.cc index 6921115c56..22cb428724 100644 --- a/src/SerialObj.cc +++ b/src/SerialObj.cc @@ -19,7 +19,7 @@ SerialObj* SerialObj::Instantiate(SerialType type) return o; } - reporter->Error(fmt("Unknown object type 0x%08x", type)); + reporter->Error("%s", fmt("Unknown object type 0x%08x", type)); return 0; } @@ -29,7 +29,7 @@ const char* SerialObj::ClassName(SerialType type) if ( f != names->end() ) return f->second; - reporter->Error(fmt("Unknown object type 0x%08x", type)); + reporter->Error("%s", fmt("Unknown object type 0x%08x", type)); return ""; } diff --git a/src/StateAccess.cc b/src/StateAccess.cc index e62904469c..93db1c0e50 100644 --- a/src/StateAccess.cc +++ b/src/StateAccess.cc @@ -350,7 +350,7 @@ void StateAccess::Replay() v->AsRecordVal()->Assign(idx, op2 ? op2->Ref() : 0); } else - reporter->Error(fmt("access replay: unknown record field %s for assign", field)); + reporter->Error("%s", fmt("access replay: unknown record field %s for assign", field)); } else if ( t == TYPE_VECTOR ) @@ -411,7 +411,7 @@ void StateAccess::Replay() v->AsRecordVal()->Assign(idx, new_val, OP_INCR); } else - reporter->Error(fmt("access replay: unknown record field %s for assign", field)); + reporter->Error("%s", fmt("access replay: unknown record field %s for assign", field)); } else if ( t == TYPE_VECTOR ) diff --git a/src/bro.bif b/src/bro.bif index 0fd20397f0..7dcea529b0 100644 --- a/src/bro.bif +++ b/src/bro.bif @@ -2181,7 +2181,7 @@ function send_id%(p: event_peer, id: string%) : bool ID* i = global_scope()->Lookup(id->CheckString()); if ( ! i ) { - reporter->Error(fmt("send_id: no global id %s", id->CheckString())); + reporter->Error("%s", fmt("send_id: no global id %s", id->CheckString())); return new Val(0, TYPE_BOOL); } @@ -2250,7 +2250,7 @@ function get_event_peer%(%) : event_peer Val* v = remote_serializer->GetPeerVal(src); if ( ! v ) { - reporter->Error(fmt("peer %d does not exist anymore", int(src))); + reporter->Error("%s", fmt("peer %d does not exist anymore", int(src))); RecordVal* p = mgr.GetLocalPeerVal(); Ref(p); return p; @@ -3295,13 +3295,13 @@ function identify_data%(data: string, return_mime: bool%): string if ( ! *magic ) { - reporter->Error(fmt("can't init libmagic: %s", magic_error(*magic))); + reporter->Error("%s", fmt("can't init libmagic: %s", magic_error(*magic))); return new StringVal(""); } if ( magic_load(*magic, 0) < 0 ) { - reporter->Error(fmt("can't load magic file: %s", magic_error(*magic))); + reporter->Error("%s", fmt("can't load magic file: %s", magic_error(*magic))); magic_close(*magic); *magic = 0; return new StringVal(""); diff --git a/src/scan.l b/src/scan.l index 88d4e9e5e0..7ebd7894e1 100644 --- a/src/scan.l +++ b/src/scan.l @@ -1030,7 +1030,7 @@ void clear_reST_doc_comments() if ( ! reST_doc_comments ) return; - fprintf(stderr, "Warning: %lu unconsumed reST comments:\n", + fprintf(stderr, "Warning: %zu unconsumed reST comments:\n", reST_doc_comments->size()); print_current_reST_doc_comments(); diff --git a/src/util.cc b/src/util.cc index 4ef83bb4ad..5f93b4aeba 100644 --- a/src/util.cc +++ b/src/util.cc @@ -478,14 +478,14 @@ bool ensure_dir(const char *dirname) { if ( errno != ENOENT ) { - reporter->Warning(fmt("can't stat directory %s: %s", + reporter->Warning("%s", fmt("can't stat directory %s: %s", dirname, strerror(errno))); return false; } if ( mkdir(dirname, 0700) < 0 ) { - reporter->Warning(fmt("can't create directory %s: %s", + reporter->Warning("%s", fmt("can't create directory %s: %s", dirname, strerror(errno))); return false; } @@ -493,7 +493,7 @@ bool ensure_dir(const char *dirname) else if ( ! S_ISDIR(st.st_mode) ) { - reporter->Warning(fmt("%s exists but is not a directory", dirname)); + reporter->Warning("%s", fmt("%s exists but is not a directory", dirname)); return false; } @@ -506,7 +506,7 @@ bool is_dir(const char* path) if ( stat(path, &st) < 0 ) { if ( errno != ENOENT ) - reporter->Warning(fmt("can't stat %s: %s", path, strerror(errno))); + reporter->Warning("%s", fmt("can't stat %s: %s", path, strerror(errno))); return false; } @@ -556,14 +556,14 @@ static bool read_random_seeds(const char* read_file, uint32* seed, if ( stat(read_file, &st) < 0 ) { - reporter->Warning(fmt("Seed file '%s' does not exist: %s", + reporter->Warning("%s", fmt("Seed file '%s' does not exist: %s", read_file, strerror(errno))); return false; } if ( ! (f = fopen(read_file, "r")) ) { - reporter->Warning(fmt("Could not open seed file '%s': %s", + reporter->Warning("%s", fmt("Could not open seed file '%s': %s", read_file, strerror(errno))); return false; } @@ -599,7 +599,7 @@ static bool write_random_seeds(const char* write_file, uint32 seed, if ( ! (f = fopen(write_file, "w+")) ) { - reporter->Warning(fmt("Could not create seed file '%s': %s", + reporter->Warning("%s", fmt("Could not create seed file '%s': %s", write_file, strerror(errno))); return false; } @@ -1024,7 +1024,7 @@ FILE* rotate_file(const char* name, RecordVal* rotate_info) FILE* newf = fopen(tmpname, "w"); if ( ! newf ) { - reporter->Error(fmt("rotate_file: can't open %s: %s", tmpname, strerror(errno))); + reporter->Error("%s", fmt("rotate_file: can't open %s: %s", tmpname, strerror(errno))); return 0; } @@ -1033,7 +1033,7 @@ FILE* rotate_file(const char* name, RecordVal* rotate_info) struct stat dummy; if ( link(name, newname) < 0 || stat(newname, &dummy) < 0 ) { - reporter->Error(fmt("rotate_file: can't move %s to %s: %s", name, newname, strerror(errno))); + reporter->Error("%s", fmt("rotate_file: can't move %s to %s: %s", name, newname, strerror(errno))); fclose(newf); unlink(newname); unlink(tmpname); @@ -1043,7 +1043,7 @@ FILE* rotate_file(const char* name, RecordVal* rotate_info) // Close current file, and move the tmp to its place. if ( unlink(name) < 0 || link(tmpname, name) < 0 || unlink(tmpname) < 0 ) { - reporter->Error(fmt("rotate_file: can't move %s to %s: %s", tmpname, name, strerror(errno))); + reporter->Error("%s", fmt("rotate_file: can't move %s to %s: %s", tmpname, name, strerror(errno))); exit(1); // hard to fix, but shouldn't happen anyway... } From 507b51c95750186350ddc8bfd2f3a8590e548455 Mon Sep 17 00:00:00 2001 From: Seth Hall Date: Wed, 2 Nov 2011 15:09:57 -0400 Subject: [PATCH 2/9] No longer write to the PacketFilter::LOG stream if not reading traffic. --- scripts/base/frameworks/packet-filter/main.bro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/base/frameworks/packet-filter/main.bro b/scripts/base/frameworks/packet-filter/main.bro index 784a7725ed..1097315172 100644 --- a/scripts/base/frameworks/packet-filter/main.bro +++ b/scripts/base/frameworks/packet-filter/main.bro @@ -144,7 +144,8 @@ function install() $sub=default_filter]); } - Log::write(PacketFilter::LOG, info); + if ( reading_live_traffic() || reading_traces() ) + Log::write(PacketFilter::LOG, info); } event bro_init() &priority=10 From f4ce631231bb895c86641b6a1feefeda89ad23bd Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Thu, 3 Nov 2011 15:28:26 -0700 Subject: [PATCH 3/9] Updating submodule(s). --- aux/binpac | 2 +- aux/bro-aux | 2 +- aux/broccoli | 2 +- aux/broctl | 2 +- cmake | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aux/binpac b/aux/binpac index c379cefad9..29143bd0d3 160000 --- a/aux/binpac +++ b/aux/binpac @@ -1 +1 @@ -Subproject commit c379cefad994004e6ca5f6ba7de038ab6da3a5f5 +Subproject commit 29143bd0d3f15d4e8903acd0e60fd9280a31e6f7 diff --git a/aux/bro-aux b/aux/bro-aux index 6c5c999d9f..17b69fd96b 160000 --- a/aux/bro-aux +++ b/aux/bro-aux @@ -1 +1 @@ -Subproject commit 6c5c999d9fe05f0e08cc55af478b6e3e47d15c53 +Subproject commit 17b69fd96b13a63a7ac66812b360a93e2ce0695d diff --git a/aux/broccoli b/aux/broccoli index 8abb08f7f6..c951bda3c8 160000 --- a/aux/broccoli +++ b/aux/broccoli @@ -1 +1 @@ -Subproject commit 8abb08f7f604bae286ddc7ae484dc7333ce7997a +Subproject commit c951bda3c8ee7719a129f8e15639479b3c80657c diff --git a/aux/broctl b/aux/broctl index 8f535292ca..a152042822 160000 --- a/aux/broctl +++ b/aux/broctl @@ -1 +1 @@ -Subproject commit 8f535292ca45d1fe7207394dbf4768d4d13ab87b +Subproject commit a152042822adfce7cdf7291262645b03ac5f8199 diff --git a/cmake b/cmake index bbf129bd7b..019ea8f3e0 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit bbf129bd7bd33dfb5641ff0d9242f4b3ebba8e82 +Subproject commit 019ea8f3e0416144c461d55b41bb935a550d9dfd From ad4bcec33873c73daf0f5a721e9d90f47d9f0884 Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Thu, 3 Nov 2011 15:36:28 -0700 Subject: [PATCH 4/9] Updating submodule(s). --- aux/bro-aux | 2 +- aux/broccoli | 2 +- aux/broctl | 2 +- cmake | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aux/bro-aux b/aux/bro-aux index 17b69fd96b..c9d0c11d53 160000 --- a/aux/bro-aux +++ b/aux/bro-aux @@ -1 +1 @@ -Subproject commit 17b69fd96b13a63a7ac66812b360a93e2ce0695d +Subproject commit c9d0c11d53499254dfb5873790ac19d74fd9a90a diff --git a/aux/broccoli b/aux/broccoli index c951bda3c8..d5942eae85 160000 --- a/aux/broccoli +++ b/aux/broccoli @@ -1 +1 @@ -Subproject commit c951bda3c8ee7719a129f8e15639479b3c80657c +Subproject commit d5942eae85193ed31326e63d43041bc16045664f diff --git a/aux/broctl b/aux/broctl index a152042822..9556343a8a 160000 --- a/aux/broctl +++ b/aux/broctl @@ -1 +1 @@ -Subproject commit a152042822adfce7cdf7291262645b03ac5f8199 +Subproject commit 9556343a8afbbd9198a6a324d7e3530634080cea diff --git a/cmake b/cmake index 019ea8f3e0..42f356da7e 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 019ea8f3e0416144c461d55b41bb935a550d9dfd +Subproject commit 42f356da7e3bcced9ebe815a96d4293c741934ae From aa8b3677f0facf0987881197da21ab02ce32bbc8 Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Thu, 3 Nov 2011 16:01:16 -0700 Subject: [PATCH 5/9] Updating submodule(s). --- aux/binpac | 2 +- aux/broccoli | 2 +- aux/broctl | 2 +- cmake | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aux/binpac b/aux/binpac index 29143bd0d3..b93f8bc906 160000 --- a/aux/binpac +++ b/aux/binpac @@ -1 +1 @@ -Subproject commit 29143bd0d3f15d4e8903acd0e60fd9280a31e6f7 +Subproject commit b93f8bc906156bf858d157221f2b246bc275702e diff --git a/aux/broccoli b/aux/broccoli index d5942eae85..b67eb1e65f 160000 --- a/aux/broccoli +++ b/aux/broccoli @@ -1 +1 @@ -Subproject commit d5942eae85193ed31326e63d43041bc16045664f +Subproject commit b67eb1e65f3fe0fbf4d3de1b5d2ff2f2da4d5749 diff --git a/aux/broctl b/aux/broctl index 9556343a8a..1c1dfb83b9 160000 --- a/aux/broctl +++ b/aux/broctl @@ -1 +1 @@ -Subproject commit 9556343a8afbbd9198a6a324d7e3530634080cea +Subproject commit 1c1dfb83b90ce501f40c650b59a2fc594742b791 diff --git a/cmake b/cmake index 42f356da7e..cc797d045f 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 42f356da7e3bcced9ebe815a96d4293c741934ae +Subproject commit cc797d045fdf6fcfea35ee05dc6e77a05e96c5c1 From 28eed39836e6a5d5e3d73c71e51947801e187c0a Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Thu, 3 Nov 2011 16:03:26 -0700 Subject: [PATCH 6/9] Updating submodule(s). --- aux/binpac | 2 +- aux/bro-aux | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aux/binpac b/aux/binpac index b93f8bc906..d1f4891f83 160000 --- a/aux/binpac +++ b/aux/binpac @@ -1 +1 @@ -Subproject commit b93f8bc906156bf858d157221f2b246bc275702e +Subproject commit d1f4891f8380877bae182d12fb0d14de48cf83c5 diff --git a/aux/bro-aux b/aux/bro-aux index c9d0c11d53..a164369864 160000 --- a/aux/bro-aux +++ b/aux/bro-aux @@ -1 +1 @@ -Subproject commit c9d0c11d53499254dfb5873790ac19d74fd9a90a +Subproject commit a164369864cf63a2aa57384e23079eca9acf4029 From 376a9853d5a871e0a156d9298efbadb936a23f72 Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Thu, 3 Nov 2011 16:04:02 -0700 Subject: [PATCH 7/9] Updating submodule(s). --- aux/broccoli | 2 +- aux/broctl | 2 +- cmake | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/aux/broccoli b/aux/broccoli index b67eb1e65f..9ad4def724 160000 --- a/aux/broccoli +++ b/aux/broccoli @@ -1 +1 @@ -Subproject commit b67eb1e65f3fe0fbf4d3de1b5d2ff2f2da4d5749 +Subproject commit 9ad4def7249133092938fd2e3acfc84d792deb03 diff --git a/aux/broctl b/aux/broctl index 1c1dfb83b9..aabc8dcc6c 160000 --- a/aux/broctl +++ b/aux/broctl @@ -1 +1 @@ -Subproject commit 1c1dfb83b90ce501f40c650b59a2fc594742b791 +Subproject commit aabc8dcc6c639abbaddaa85327e9f4dc5d65f8d2 diff --git a/cmake b/cmake index cc797d045f..d3882f659b 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit cc797d045fdf6fcfea35ee05dc6e77a05e96c5c1 +Subproject commit d3882f659bda26b0106f713c5a0eaa22be0939a7 From 506ce026ed59cd141483f31214e415015db36fd6 Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Thu, 3 Nov 2011 16:10:40 -0700 Subject: [PATCH 8/9] Updating submodule(s). --- aux/binpac | 2 +- aux/bro-aux | 2 +- aux/broccoli | 2 +- aux/broctl | 2 +- cmake | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/aux/binpac b/aux/binpac index d1f4891f83..e0b7d838c1 160000 --- a/aux/binpac +++ b/aux/binpac @@ -1 +1 @@ -Subproject commit d1f4891f8380877bae182d12fb0d14de48cf83c5 +Subproject commit e0b7d838c10da57d09a6645a64ee6fee47e0507d diff --git a/aux/bro-aux b/aux/bro-aux index a164369864..c876be28ab 160000 --- a/aux/bro-aux +++ b/aux/bro-aux @@ -1 +1 @@ -Subproject commit a164369864cf63a2aa57384e23079eca9acf4029 +Subproject commit c876be28ab59a663ace668b63b14dc39936199df diff --git a/aux/broccoli b/aux/broccoli index 9ad4def724..1553a19a55 160000 --- a/aux/broccoli +++ b/aux/broccoli @@ -1 +1 @@ -Subproject commit 9ad4def7249133092938fd2e3acfc84d792deb03 +Subproject commit 1553a19a559765989d7c0297e357f0402dff1a69 diff --git a/aux/broctl b/aux/broctl index aabc8dcc6c..32ffde0e08 160000 --- a/aux/broctl +++ b/aux/broctl @@ -1 +1 @@ -Subproject commit aabc8dcc6c639abbaddaa85327e9f4dc5d65f8d2 +Subproject commit 32ffde0e08d7f33aa20954755586174b4aa041c9 diff --git a/cmake b/cmake index d3882f659b..704e255d7e 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit d3882f659bda26b0106f713c5a0eaa22be0939a7 +Subproject commit 704e255d7ef2faf926836c1c64d16c5b8a02b063 From 9aef0c0f5a7e7591705876ece176b283cb728223 Mon Sep 17 00:00:00 2001 From: Robin Sommer Date: Thu, 3 Nov 2011 17:41:00 -0700 Subject: [PATCH 9/9] Fixing packet filter test. Adapting the IPv6 one as well, though I believe that's already broken anyway ... --- CHANGES | 4 ++++ VERSION | 2 +- testing/btest/Baseline/core.print-bpf-filters-ipv4/output | 8 ++++---- testing/btest/core/print-bpf-filters-ipv4.bro | 8 ++++---- testing/btest/core/print-bpf-filters-ipv6.bro | 8 ++++---- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index 006f827db8..8372329d0e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ +2.0-beta-19 | 2011-11-03 17:41:00 -0700 + + * Fixing packet filter test. (Robin Sommer) + 2.0-beta-12 | 2011-11-03 15:21:08 -0700 * No longer write to the PacketFilter::LOG stream if not reading diff --git a/VERSION b/VERSION index 827f665253..ce0cb3814c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0-beta-12 +2.0-beta-19 diff --git a/testing/btest/Baseline/core.print-bpf-filters-ipv4/output b/testing/btest/Baseline/core.print-bpf-filters-ipv4/output index 24e3e9237b..4f6230b768 100644 --- a/testing/btest/Baseline/core.print-bpf-filters-ipv4/output +++ b/testing/btest/Baseline/core.print-bpf-filters-ipv4/output @@ -2,19 +2,19 @@ #path packet_filter #fields ts node filter init success #types time string string bool bool -1318009349.267385 - not ip6 F T +1320367155.152502 - not ip6 T T #separator \x09 #path packet_filter #fields ts node filter init success #types time string string bool bool -1318009349.503033 - (((((((((((((((((((((((((port 53) or (tcp port 989)) or (tcp port 443)) or (port 6669)) or (udp and port 5353)) or (port 6668)) or (udp and port 5355)) or (tcp port 22)) or (tcp port 995)) or (port 21)) or (tcp port 25 or tcp port 587)) or (port 6667)) or (tcp port 614)) or (tcp port 990)) or (udp port 137)) or (tcp port 993)) or (tcp port 5223)) or (port 514)) or (tcp port 585)) or (tcp port 992)) or (tcp port 563)) or (tcp port 994)) or (tcp port 636)) or (tcp and port (80 or 81 or 631 or 1080 or 3138 or 8000 or 8080 or 8888))) or (port 6666)) and (not ip6) F T +1320367155.379066 - (((((((((((((((((((((((((port 53) or (tcp port 989)) or (tcp port 443)) or (port 6669)) or (udp and port 5353)) or (port 6668)) or (udp and port 5355)) or (tcp port 22)) or (tcp port 995)) or (port 21)) or (tcp port 25 or tcp port 587)) or (port 6667)) or (tcp port 614)) or (tcp port 990)) or (udp port 137)) or (tcp port 993)) or (tcp port 5223)) or (port 514)) or (tcp port 585)) or (tcp port 992)) or (tcp port 563)) or (tcp port 994)) or (tcp port 636)) or (tcp and port (80 or 81 or 631 or 1080 or 3138 or 8000 or 8080 or 8888))) or (port 6666)) and (not ip6) T T #separator \x09 #path packet_filter #fields ts node filter init success #types time string string bool bool -1318009349.748468 - port 42 F T +1320367155.601980 - port 42 T T #separator \x09 #path packet_filter #fields ts node filter init success #types time string string bool bool -1318009349.995387 - port 56730 T T +1320367155.826539 - port 56730 T T diff --git a/testing/btest/core/print-bpf-filters-ipv4.bro b/testing/btest/core/print-bpf-filters-ipv4.bro index e1aeb3f95f..5a3b0cf7ce 100644 --- a/testing/btest/core/print-bpf-filters-ipv4.bro +++ b/testing/btest/core/print-bpf-filters-ipv4.bro @@ -1,12 +1,12 @@ # @TEST-REQUIRES: bro -e 'print bro_has_ipv6()' | grep -q F # -# @TEST-EXEC: bro -e '' >output +# @TEST-EXEC: bro -r $TRACES/empty.trace -e '' >output # @TEST-EXEC: cat packet_filter.log >>output -# @TEST-EXEC: bro PacketFilter::all_packets=F >>output +# @TEST-EXEC: bro -r $TRACES/empty.trace PacketFilter::all_packets=F >>output # @TEST-EXEC: cat packet_filter.log >>output -# @TEST-EXEC: bro -f "port 42" -e '' >>output +# @TEST-EXEC: bro -r $TRACES/empty.trace -f "port 42" -e '' >>output # @TEST-EXEC: cat packet_filter.log >>output -# @TEST-EXEC: bro -C -f "port 56730" -r $TRACES/mixed-vlan-mpls.trace >>output +# @TEST-EXEC: bro -r $TRACES/empty.trace -C -f "port 56730" -r $TRACES/mixed-vlan-mpls.trace >>output # @TEST-EXEC: cat packet_filter.log >>output # @TEST-EXEC: btest-diff output # @TEST-EXEC: btest-diff conn.log diff --git a/testing/btest/core/print-bpf-filters-ipv6.bro b/testing/btest/core/print-bpf-filters-ipv6.bro index c4378f8ec6..824c979d70 100644 --- a/testing/btest/core/print-bpf-filters-ipv6.bro +++ b/testing/btest/core/print-bpf-filters-ipv6.bro @@ -1,12 +1,12 @@ # @TEST-REQUIRES: bro -e 'print bro_has_ipv6()' | grep -q T # -# @TEST-EXEC: bro -e '' >output +# @TEST-EXEC: bro -r $TRACES/empty.trace -e '' >output # @TEST-EXEC: cat packet_filter.log >>output -# @TEST-EXEC: bro PacketFilter::all_packets=F ssh >>output +# @TEST-EXEC: bro -r $TRACES/empty.trace PacketFilter::all_packets=F >>output # @TEST-EXEC: cat packet_filter.log >>output -# @TEST-EXEC: bro -f "port 42" -e '' >>output +# @TEST-EXEC: bro -r $TRACES/empty.trace -f "port 42" -e '' >>output # @TEST-EXEC: cat packet_filter.log >>output -# @TEST-EXEC: bro -C -f "port 56730" -r $TRACES/mixed-vlan-mpls.trace conn >>output +# @TEST-EXEC: bro -r $TRACES/empty.trace -C -f "port 56730" -r $TRACES/mixed-vlan-mpls.trace >>output # @TEST-EXEC: cat packet_filter.log >>output # @TEST-EXEC: btest-diff output # @TEST-EXEC: btest-diff conn.log