Skip to content

Commit f1451fd

Browse files
authored
fix(plugin-install): anchor checksum grep to exact filename (cloudnative-pg#10411)
The checksums file now includes `.sbom.json` entries for each artifact. The unanchored `grep` in `hash_sha256_verify` matched both the tarball and its `.sbom.json` entry, producing a multi-line "want" value that never matched the computed hash, causing the install script to fail with a checksum mismatch error. Anchor the pattern to the exact filename (`" ${BASENAME}$"`) to avoid false matches. Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
1 parent 46efe17 commit f1451fd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

hack/install-cnpg-plugin.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ hash_sha256_verify() {
354354
return 1
355355
fi
356356
BASENAME=${TARGET##*/}
357-
want=$(grep "${BASENAME}" "${checksums}" 2>/dev/null | tr '\t' ' ' | cut -d ' ' -f 1)
357+
want=$(grep " ${BASENAME}$" "${checksums}" 2>/dev/null | tr '\t' ' ' | cut -d ' ' -f 1)
358358
if [ -z "$want" ]; then
359359
log_err "hash_sha256_verify unable to find checksum for '${TARGET}' in '${checksums}'"
360360
return 1

0 commit comments

Comments
 (0)