Blame SOURCES/0001-acl-2.2.53-test-runwrapper.patch

952975
From 085cc4ff56857d234e80f37d0316c13eb5718696 Mon Sep 17 00:00:00 2001
952975
From: Kamil Dudka <kdudka@redhat.com>
952975
Date: Tue, 3 Jul 2018 10:46:58 +0200
952975
Subject: [PATCH] test/runwrapper: copy the preloaded library
952975
952975
... to a temporary directory because the original location might
952975
not be accessible by other users.
952975
---
952975
 test/runwrapper | 20 ++++++++++++++++++--
952975
 1 file changed, 18 insertions(+), 2 deletions(-)
952975
952975
diff --git a/test/runwrapper b/test/runwrapper
952975
index 6e0e899..de4555a 100755
952975
--- a/test/runwrapper
952975
+++ b/test/runwrapper
952975
@@ -1,7 +1,23 @@
952975
 #!/bin/bash
952975
 
952975
-if [ -e "$PWD/.libs/libtestlookup.so" ]; then
952975
-	export LD_PRELOAD="$PWD/.libs/libtestlookup.so"
952975
+src="$PWD/.libs/libtestlookup.so"
952975
+dst=
952975
+if [ -e "$src" ]; then
952975
+	# copy the preloaded library to a temporary directory because
952975
+	# the original location might not be accessible by other users
952975
+	tmp="$(mktemp -d)"
952975
+	chmod 0755 "$tmp"
952975
+	dst="${tmp}/libtestlookup.so"
952975
+	cp -L "$src" "$dst"
952975
+	export LD_PRELOAD="$dst"
952975
 fi
952975
 
952975
 "${srcdir:-${PWD}}"/test/run "$@"
952975
+ec="$?"
952975
+
952975
+if [ -n "$dst" ]; then
952975
+	# remove the temporary location
952975
+	rm -rf "$dst"
952975
+fi
952975
+
952975
+exit "$ec"
952975
-- 
952975
2.14.4
952975