From ed0cee645f6747190ded18780c45c906332d0b03 Mon Sep 17 00:00:00 2001 From: Bjørn Forsman Date: Sat, 1 Dec 2018 16:16:01 +0100 Subject: audit-tmpdir hook: use abspath matching on RPATH entries This ensures that RPATH entries like "/foo/build/bar" doesn't trigger a match when TMPDIR is "/build/bar". (I've had this problem with a prebuilt package.) --- pkgs/build-support/setup-hooks/audit-tmpdir.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/build-support/setup-hooks') diff --git a/pkgs/build-support/setup-hooks/audit-tmpdir.sh b/pkgs/build-support/setup-hooks/audit-tmpdir.sh index 43ea0d6caec..291f7f306f7 100644 --- a/pkgs/build-support/setup-hooks/audit-tmpdir.sh +++ b/pkgs/build-support/setup-hooks/audit-tmpdir.sh @@ -20,7 +20,7 @@ auditTmpdir() { if [[ "$i" =~ .build-id ]]; then continue; fi if isELF "$i"; then - if patchelf --print-rpath "$i" | grep -q -F "$TMPDIR/"; then + if { printf :; patchelf --print-rpath "$i"; } | grep -q -F ":$TMPDIR/"; then echo "RPATH of binary $i contains a forbidden reference to $TMPDIR/" exit 1 fi -- cgit 1.4.1