summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Festi <ffesti@redhat.com>2021-06-21 13:34:42 +0200
committerPanu Matilainen <pmatilai@redhat.com>2021-06-22 15:02:29 +0300
commitbff90159d11ac25c442934bc71b9e1ea5dd6a695 (patch)
treea53d6ff655dfe3ab4749983a9f6b95d18fc6d18f
parent412c6c7f124f3500fc0e35183ba8b9bdac4cce33 (diff)
downloadrpm-bff90159d11ac25c442934bc71b9e1ea5dd6a695.tar.gz
check-rpaths: Look for RPATH and RUNPATH in one go
Calculate $lower from the actual match (cherry picked from commit 5417bffe37a9dfbfd33734f3f46d82adb927463b)
-rwxr-xr-xscripts/check-rpaths-worker10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/check-rpaths-worker b/scripts/check-rpaths-worker
index 6399c4fa0..39e72f797 100755
--- a/scripts/check-rpaths-worker
+++ b/scripts/check-rpaths-worker
@@ -94,9 +94,9 @@ function msg()
function check_rpath() {
pos=0
- rpath=$(readelf -W -d "$1" 2>/dev/null | LANG=C grep "($2).*:") || return 0
- rpath=$(echo "$rpath" | LANG=C sed -e "s!.*($2).*: \[\(.*\)\]!\1!p;d")
- lower=$(echo $2 | awk '{print tolower($0)}')
+ rpath=$(readelf -W -d "$1" 2>/dev/null | LANG=C grep -E "\((RPATH|RUNPATH)\).*:") || return 0
+ rpath=$(echo "$rpath" | LANG=C sed -e "s!.*\(RPATH\|RUNPATH\).*: \[\(.*\)\]!\2!p;d")
+
tmp=aux:$rpath:/lib/aux || :
IFS=:
set -- $tmp
@@ -105,6 +105,7 @@ function check_rpath() {
allow_ORIGIN=1
for j; do
+ lower=$(echo $j | grep -E -o "RPATH|RUNPATH" | awk '{print tolower($0)}')
new_allow_ORIGIN=0
if test -z "$j"; then
@@ -155,8 +156,7 @@ function check_rpath() {
old_IFS=$IFS
for i; do
- check_rpath $i "RPATH"
- check_rpath $i "RUNPATH"
+ check_rpath $i
done
test -z "$fail"