diff options
author | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-07-20 14:44:30 +0200 |
---|---|---|
committer | Quentin Dufour <quentin@deuxfleurs.fr> | 2022-07-26 18:27:46 +0200 |
commit | 76cb34a0ae716173d9bed6d6dcb53903762255a8 (patch) | |
tree | 0e41ee523896bd52453199675d16f2e696d28d19 /script/not-dynamic.sh | |
parent | ac03fa7937d9da29d2358343a499fe9d15ac5f7c (diff) | |
download | garage-76cb34a0ae716173d9bed6d6dcb53903762255a8.tar.gz garage-76cb34a0ae716173d9bed6d6dcb53903762255a8.zip |
Fail if compiled binary is dynamic
Diffstat (limited to 'script/not-dynamic.sh')
-rwxr-xr-x | script/not-dynamic.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/script/not-dynamic.sh b/script/not-dynamic.sh new file mode 100755 index 00000000..b9a13070 --- /dev/null +++ b/script/not-dynamic.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -e + +if [ "$#" -ne 1 ]; then + echo "[fail] usage: $0 binary" + exit 2 +fi + +if file $1 | grep 'dynamically linked' 2>&1; then + echo "[fail] $1 is dynamic" + exit 1 +fi +echo "[ok] $1 is probably static" |