]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
check-rpaths: Normalize paths before checking the whitelist
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Nov 2022 15:37:36 +0000 (15:37 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 22 Nov 2022 15:37:36 +0000 (15:37 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/scripts/check-rpaths

index 128f598ce8eba7809c161836f6513b847abec07b..157d233177fafbdc44d3f5ab31ffca1b3513e88a 100644 (file)
@@ -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