From 76cb34a0ae716173d9bed6d6dcb53903762255a8 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Wed, 20 Jul 2022 14:44:30 +0200 Subject: Fail if compiled binary is dynamic --- script/not-dynamic.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 script/not-dynamic.sh (limited to 'script') 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" -- cgit v1.2.3