From 616d62efdeaacd35977aaabd25c735e0e9bf962c Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Fri, 13 Sep 2024 12:33:22 +0200 Subject: [PATCH] Capture cmd for when statement This is required since quite a while. --- scripts/plugins/store-files-by-sha1.zeek | 4 ++-- scripts/plugins/store-files-by-sha256.zeek | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/plugins/store-files-by-sha1.zeek b/scripts/plugins/store-files-by-sha1.zeek index 8a1aca5..5f307d1 100644 --- a/scripts/plugins/store-files-by-sha1.zeek +++ b/scripts/plugins/store-files-by-sha1.zeek @@ -15,9 +15,9 @@ event file_state_remove(f: fa_file) local dest = fmt("%s%s-%s.%s", FileExtraction::path, f$source, f$info$sha1, extension); local cmd = fmt("mv %s %s", orig, dest); - when ( local result = Exec::run([$cmd=cmd]) ) + when [cmd] ( local result = Exec::run([$cmd=cmd]) ) { - } + } f$info$extracted = dest; } diff --git a/scripts/plugins/store-files-by-sha256.zeek b/scripts/plugins/store-files-by-sha256.zeek index e32383c..942de56 100644 --- a/scripts/plugins/store-files-by-sha256.zeek +++ b/scripts/plugins/store-files-by-sha256.zeek @@ -30,7 +30,7 @@ event file_state_remove(f: fa_file) local dest = fmt("%s%s-%s.%s", FileExtraction::path, f$source, f$info$sha256, extension); local cmd = fmt("mv %s %s", orig, dest); - when ( local result = Exec::run([$cmd=cmd]) ) + when [cmd] ( local result = Exec::run([$cmd=cmd]) ) { } f$info$extracted = dest;