Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
philrz committed Jan 3, 2024
1 parent af54541 commit 35f6c4e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
9 changes: 3 additions & 6 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,8 @@ install_zeek_package() {

build_command=$(zkg_meta package build_command)
if [ "$build_command" ]; then
if [ "$OS" = Windows_NT ]; then
export LDFLAGS='-static -Wl,--allow-multiple-definition'
fi
sh -c "$build_command"
$sudo tar -xf build/*.tgz -C /usr/local/zeek/lib/zeek/plugins
echo "building plugins not currently supported"
exit 1
fi

test_command=$(zkg_meta package test_command)
Expand Down Expand Up @@ -86,7 +83,7 @@ echo "@load policy/protocols/conn/community-id-logging" | $sudo tee -a /usr/loca
mkdir -p zeek/bin zeek/lib/zeek zeek/share/zeek
cp zeekrunner$exe zeek/
cp /usr/local/zeek/bin/zeek$exe zeek/bin/
cp -R /usr/local/zeek/lib/zeek/plugins zeek/lib/zeek/
cp -R zeek/lib/zeek/
for d in base policy site builtin-plugins; do
cp -R /usr/local/zeek/share/zeek/$d zeek/share/zeek/
done
Expand Down
1 change: 0 additions & 1 deletion zeekrunner
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"

export ZEEKPATH=$dir/share/zeek:$dir/share/zeek/policy:$dir/share/zeek/site
export ZEEK_PLUGIN_PATH=$dir/lib/zeek/plugins

# The packet filter and loaded scripts are disabled because they emit either
# timeless logs or logs with timestamp set to execution time rather than time
Expand Down
6 changes: 1 addition & 5 deletions zeekrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ var (
"share/zeek/policy",
"share/zeek/site",
}
zeekPluginRelPaths = []string{
"lib/zeek/plugins",
}
)

func pathEnvVar(name, topDir string, subdirs []string) string {
Expand All @@ -46,13 +43,12 @@ event zeek_init() {

func launchZeek(zdepsZeekDir, zeekExecPath string) error {
zeekPath := pathEnvVar("ZEEKPATH", zdepsZeekDir, zeekPathRelPaths)
zeekPlugin := pathEnvVar("ZEEK_PLUGIN_PATH", zdepsZeekDir, zeekPluginRelPaths)

cmd := exec.Command(zeekExecPath, "-C", "-r", "-", "--exec", ExecScript, "local")
cmd.Stdin = os.Stdin
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Env = append(os.Environ(), zeekPath, zeekPlugin)
cmd.Env = append(os.Environ(), zeekPath)

return cmd.Run()
}
Expand Down

0 comments on commit 35f6c4e

Please sign in to comment.