acl/0001-acl-2.2.53-test-runwrapper.patch
Petr Šabata 3802625c40 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/acl#e0b4e6db205b02c77e5936fe858cd1f84a0287b4
2020-10-14 21:30:23 +02:00

45 lines
1.1 KiB
Diff

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