diff mbox series

[3/6] lib/oe/package: use cachedpath.is_executable() instead of os.access()

Message ID 20261019145837.2487873-3-ross.burton@arm.com
State New
Headers show
Series [1/6] lib/oe/sstatesig: cache the user/group lookups in OEOuthashBasic | expand

Commit Message

Ross Burton Oct. 19, 2026, 2:58 p.m. UTC
os.access() asks if the *current user* can run the specified binary,
which isn't what we care about when packaging.

We simply want to know if the binary has executable bits set so check
the mode, using cachedpath.is_executable() to avoid another stat() call.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/lib/oe/package.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index 5d4966be295..5938798cef0 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -1780,7 +1780,7 @@  def process_shlibs(pkgfiles, d):
                     darwin_so(file, needed, sonames, pkgver)
                 elif hostos.startswith("mingw"):
                     mingw_dll(file, needed, sonames, pkgver)
-                elif os.access(file, os.X_OK) or lib_re.match(file):
+                elif cpath.is_executable(file) or lib_re.match(file):
                     linuxlist.append(file)
 
         if linuxlist: