Fix check-rpaths-worker: add missing /usr/local/lib and /usr/local/lib64 to 
bare-directory patterns

### Problem
 When a binary's RPATH contains /usr/local/lib or /usr/local/lib64 (without a 
trailing slash), check-rpaths-worker misclassifies it as badness=2 ("invalid 
RPATH — neither absolute nor relative — SECURITY risk", 
 error code 0x0002). This is misleading because:

 1. The path is absolute — the error message is factually wrong.
 2. The same directory with a trailing slash (/usr/local/lib/) or subdirectory 
(/usr/local/lib/foo) is correctly classified as badness=0 (approved) since the 
wildcard pattern /* matches them.
 3. The analogous bare directories /usr/lib, /usr/lib64, /usr/X11R6/lib, 
/usr/X11R6/lib64 are already correctly classified as badness=1 (standard RPATH, 
minor issue 0x0001).

### Root Cause
 The case statement in check_rpath() has two sets of patterns for standard 
library directories:

 - With /* (approved / badness=0): includes /usr/local/lib/* and 
/usr/local/lib64/*
 - Bare (standard / badness=1): was missing /usr/local/lib and /usr/local/lib64

 A bare /usr/local/lib therefore fell through to the catch-all (*) badness=2.

### Fix
 Add /usr/local/lib and /usr/local/lib64 to the bare badness=1 patterns, 
consistent with /usr/lib and /usr/lib64.

Fixes: #4266
You can view, comment on, or merge this pull request online at:

  https://github.com/rpm-software-management/rpm/pull/4296

-- Commit Summary --

  * scripts: add /usr/local/lib{64} to bare-dir standard-RPATH patterns

-- File Changes --

    M scripts/check-rpaths-worker (4)

-- Patch Links --

https://github.com/rpm-software-management/rpm/pull/4296.patch
https://github.com/rpm-software-management/rpm/pull/4296.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/4296
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/[email protected]>
_______________________________________________
Rpm-maint mailing list
[email protected]
https://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to