Skip to content

Commit 4ff03c3

Browse files
committed
hash check.
1 parent 8579bd9 commit 4ff03c3

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

containers/scripts/install_gosu.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@ esac
2525

2626
gosu_url="https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-${gosu_arch}"
2727

28+
case "${GOSU_VERSION}:${gosu_arch}" in
29+
1.10:amd64)
30+
gosu_sha256="5b3b03713a888cee84ecbf4582b21ac9fd46c3d935ff2d7ea25dd5055d302d3c"
31+
;;
32+
1.10:arm64)
33+
gosu_sha256="3ebbff47692c3d9f0c3b6500727e277cb23d621feebcac0cc3d9e382d62d1acb"
34+
;;
35+
1.10:i386)
36+
gosu_sha256="2dfac0dd8830ebccea486d90472b48e68de5a543d9fb50bea933bbe6a9c8d610"
37+
;;
38+
*)
39+
echo "Unsupported gosu version/architecture for checksum verification: ${GOSU_VERSION}/${gosu_arch}" >&2
40+
exit 1
41+
;;
42+
esac
43+
2844
if command -v wget >/dev/null 2>&1; then
2945
wget -nv -O /usr/local/bin/gosu "${gosu_url}"
3046
elif command -v curl >/dev/null 2>&1; then
@@ -34,5 +50,6 @@ else
3450
exit 1
3551
fi
3652

53+
printf '%s %s\n' "${gosu_sha256}" /usr/local/bin/gosu | sha256sum -c -
3754
chmod +x /usr/local/bin/gosu
3855
gosu nobody true

0 commit comments

Comments
 (0)