From 38a38333519ce85755dfdce58d67707d578ac42b Mon Sep 17 00:00:00 2001 From: bol-van Date: Wed, 28 May 2025 23:06:12 +0300 Subject: [PATCH] install_bin: do exec test after elf test --- install_bin.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/install_bin.sh b/install_bin.sh index b64bebbf..067bd50e 100755 --- a/install_bin.sh +++ b/install_bin.sh @@ -82,7 +82,11 @@ check_dir() ;; elf) out=$(read_elf_arch "$exe") - [ "$ELF_ARCH" = "$out" ] + [ "$ELF_ARCH" = "$out" ] && { + # exec test to verify it actually works. no illegal instruction or crash. + out=$(echo 0.0.0.0 | "$exe" 2>/dev/null) + [ -n "$out" ] + } ;; find) out=$(echo 0.0.0.0 | $FIND "$dir" -maxdepth 1 -name ip2net -exec {} \; 2>/dev/null)