From ce4494d8d361be30eb44db43f9705bcafe3424d9 Mon Sep 17 00:00:00 2001 From: Christian Kreibich Date: Fri, 21 Apr 2023 13:43:34 -0700 Subject: [PATCH] Given the -C flag, set script-layer ignore_checksums to true. --- src/zeek-setup.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/zeek-setup.cc b/src/zeek-setup.cc index 7b2878653f..768d4b7e7e 100644 --- a/src/zeek-setup.cc +++ b/src/zeek-setup.cc @@ -1010,6 +1010,17 @@ SetupResult setup(int argc, char** argv, Options* zopts) exit(0); } + if ( options.ignore_checksums ) + { + const auto& id = global_scope()->Find("ignore_checksums"); + + if ( ! id ) + reporter->InternalError("global ignore_checksums not defined"); + + id->SetVal(zeek::val_mgr->True()); + ignore_checksums = 1; + } + // Print the ID. if ( options.identifier_to_print ) { @@ -1082,9 +1093,6 @@ SetupResult setup(int argc, char** argv, Options* zopts) g_frame_stack.pop_back(); } - if ( options.ignore_checksums ) - ignore_checksums = 1; - if ( zeek_script_loaded ) { // Queue events reporting loaded scripts.