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.)
This commit is contained in:
Bjørn Forsman 2018-12-01 16:16:01 +01:00
parent 84162175a3
commit ed0cee645f

View File

@ -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