Skip to contentSkip to conversation

systemd: Improve detection of executables and libraries

PATCH New Anusmita Dutta Mazumder 1 participant 1 message Oct 30

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 systemd: Improve detection of executables and libraries

Use cached mode bits to detect executables independently of host access permissions. Check shared-library basenames to avoid matching directory names.

---
Changes in v2:
- Replace the regex with basename string checks, as suggested.

 meta/recipes-core/systemd/dlopen-deps.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-core/systemd/dlopen-deps.inc +2 -1
index 37074a9682..18c5595d14 100644
@@ -61,7 +61,8 @@ python package_generate_dlopen_deps() {
             if cpath.islink(f):
                 continue
 
-            if os.access(f, os.X_OK) or ".so." in f or f.endswith(".so"):
+            # Scan shared libraries and executable files for dlopen notes.
+            if cpath.is_executable(f) or ".so." in os.path.basename(f) or f.endswith(".so"):
                 try:
                     elf = oe.qa.ELFFile(f)
                     elf.open()