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

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