]> granicus.if.org Git - p11-kit/commitdiff
test: Avoid exceeding maximum pathname length of Unix socket
authorDaiki Ueno <dueno@redhat.com>
Thu, 3 May 2018 15:29:40 +0000 (17:29 +0200)
committerDaiki Ueno <ueno@gnu.org>
Fri, 4 May 2018 07:39:09 +0000 (09:39 +0200)
p11-kit/test-server.sh

index e9455dc4db82af5f4976f0c0d46b3c34a8a4035b..e1d27ac7d55e425aad3f3ec0819d606fad5e106e 100755 (executable)
@@ -1,7 +1,12 @@
 #!/bin/sh
 
-testdir=$PWD/test-server-$$
-test -d "$testdir" || mkdir "$testdir"
+set -e
+
+testdir=`mktemp -d -t test-server.XXXXXX`
+if test $? -ne 0; then
+       echo "cannot create temporary directory" >&2
+       exit 77
+fi
 
 cleanup () {
        rm -rf "$testdir"