Merge pull request #15308 from Security-Onion-Solutions/idstools-refactor

Add trailing nl if it doesnt already exist
This commit is contained in:
Jason Ertel
2025-12-14 15:35:24 -05:00
committed by GitHub

View File

@@ -1174,11 +1174,12 @@ hash_normalized_file() {
return 1
fi
sed -E \
# Ensure trailing newline for consistent hashing regardless of source file
{ sed -E \
-e 's/^[[:space:]]+//; s/[[:space:]]+$//' \
-e '/^$/d' \
-e 's|--url=http://[^:]+:7788|--url=http://MANAGER:7788|' \
"$file" | sha256sum | awk '{print $1}'
"$file"; echo; } | sed '/^$/d' | sha256sum | awk '{print $1}'
}
# Known-default hashes for so-rule-update (ETOPEN ruleset)