From af393afc090259d44cdc1ae69effdd02efc1628d Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Thu, 30 Aug 2018 09:08:33 -0400 Subject: [PATCH] make preload script for testing a bit more robust --- preload.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/preload.sh b/preload.sh index 40d13f5..f6b155e 100755 --- a/preload.sh +++ b/preload.sh @@ -1,5 +1,6 @@ #!/bin/bash -dir=$(cd "$(dirname ${BASH_SOURCE[0]})" && pwd) -export LD_PRELOAD+=" $dir/hardened_malloc.so" -exec $@ +dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +[[ $LD_PRELOAD ]] && LD_PRELOAD+=" " +export LD_PRELOAD+="$dir/hardened_malloc.so" +exec "$@"