From 6e19722c7b67f8dadfb8fb3a3c8d68e3d46c612b Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 22 Nov 2022 15:37:36 +0000 Subject: [PATCH] check-rpaths: Normalize paths before checking the whitelist Signed-off-by: Michael Tremer --- src/scripts/check-rpaths | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/scripts/check-rpaths b/src/scripts/check-rpaths index 128f598ce..157d23317 100644 --- a/src/scripts/check-rpaths +++ b/src/scripts/check-rpaths @@ -46,12 +46,13 @@ main() { local rpath="$(readelf -d "${file}" 2>/dev/null | grep RPATH | \ tr -d "[]" | awk '{ print $NF }')" - case "${rpath}" in - # No RPATH set - "") - continue - ;; + # Ignore any empty paths + [ -z "${rpath}" ] && continue + # Normalize the path + rpath="$(readlink -m "${rpath}")" + + case "${rpath}" in # Ignore anything pointing at /lib(64) and /usr/lib(64) /lib|/lib64|/usr/lib|/usr/lib64) continue -- 2.39.5