From 8a3503350f819f4190a9b05fd613ad08a5c8bf8c Mon Sep 17 00:00:00 2001 From: Mike Miller Date: Wed, 14 Dec 2016 10:02:13 -0800 Subject: [PATCH] tests: avoid using eval with variable assignments For shell portability, avoid using eval with variable assignments to set openconnect's environment. Shell implementations vary on whether variable assignments in front of eval are marked as environment variables or just treated as ordinary shell assignments. Every call to $OPENCONNECT already has LD_PRELOAD=libsocket_wrapper.so in front of it, so the "eval LD_PRELOAD=libsocket_wrapper.so" was redundant anyway. Signed-off-by: Mike Miller Signed-off-by: David Woodhouse --- tests/auth-pkcs11 | 2 +- tests/common.sh | 2 +- www/changelog.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/auth-pkcs11 b/tests/auth-pkcs11 index adc40f5a..5e9bab73 100755 --- a/tests/auth-pkcs11 +++ b/tests/auth-pkcs11 @@ -37,7 +37,7 @@ for TOKEN in ${pkcs11_tokens}; do echo -n "Connecting to obtain cookie (token ${TOKEN} key ${KEY})... " CERTURI="pkcs11:token=${TOKEN};${KEY};pin-value=1234" ( echo "test" | HOME=${srcdir} SOFTHSM2_CONF=softhsm2.conf LD_PRELOAD=libsocket_wrapper.so \ - $OPENCONNECT -q $ADDRESS:443 -u test -c \"${CERTURI}\" --key-password 1234 --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly --passwd-on-stdin ) || + $OPENCONNECT -q $ADDRESS:443 -u test -c "${CERTURI}" --key-password 1234 --servercert=d66b507ae074d03b02eafca40d35f87dd81049d3 --cookieonly --passwd-on-stdin ) || fail $PID "Could not connect with token ${TOKEN} key ${KEY##*/}!" done done diff --git a/tests/common.sh b/tests/common.sh index d89cf835..6d5736a8 100644 --- a/tests/common.sh +++ b/tests/common.sh @@ -31,7 +31,7 @@ mkdir -p $SOCKDIR export SOCKET_WRAPPER_DIR=$SOCKDIR export SOCKET_WRAPPER_DEFAULT_IFACE=2 ADDRESS=127.0.0.$SOCKET_WRAPPER_DEFAULT_IFACE -OPENCONNECT="eval LD_PRELOAD=libsocket_wrapper.so ${top_builddir}/openconnect" +OPENCONNECT="${top_builddir}/openconnect" certdir="${srcdir}/certs" confdir="${srcdir}/configs" diff --git a/www/changelog.xml b/www/changelog.xml index 93920b69..f5df1fdc 100644 --- a/www/changelog.xml +++ b/www/changelog.xml @@ -15,7 +15,7 @@
  • OpenConnect HEAD
      -
    • No changelog entries yet
    • +
    • Fix portability of shell scripts in test suite.

  • OpenConnect v7.08