]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Clean up after zero length key test
authorSebastian Hahn <sebastian@torproject.org>
Fri, 6 Feb 2015 22:21:20 +0000 (23:21 +0100)
committerNick Mathewson <nickm@torproject.org>
Wed, 11 Feb 2015 20:59:34 +0000 (15:59 -0500)
src/test/zero_length_keys.sh

index 729baebfea61299d11c22557455861ad52c27e72..7c99564f1a15a88f439ef4d66b23ff6c3adb2a80 100755 (executable)
@@ -26,6 +26,12 @@ if [ $# -lt 1 ]; then
 fi
 
 DATA_DIR=`mktemp -d -t tor_zero_length_keys.XXXXXX`
+if [ -z "$DATA_DIR" ]; then
+  echo "Failure: mktemp invocation returned empty string"
+  exit 255
+fi
+trap "rm -rf '$DATA_DIR'" 0
+
 # DisableNetwork means that the ORPort won't actually be opened.
 # 'ExitRelay 0' suppresses a warning.
 TOR="./src/or/tor --hush --DisableNetwork 1 --ShutdownWaitLength 0 --ORPort 12345 --ExitRelay 0"