From 26f35f866cf7888431963cf4fc5d2019cd28de74 Mon Sep 17 00:00:00 2001 From: Peter Marko Date: Thu, 20 Mar 2025 13:15:33 +0100 Subject: [PATCH] spdx30: handle links to inaccessible locations This is the same as e105befbe4ee0d85e94c2048a744f0373e2dbcdf on additional place in the code. When a link is pointing to location inaccessible to build user (e.g. "/root/something"), filepath.is_file() throws "PermissionError: [Errno 13] Permission denied". Fix this by first checking if it is a link. Signed-off-by: Peter Marko Signed-off-by: Richard Purdie --- meta/lib/oe/spdx30_tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meta/lib/oe/spdx30_tasks.py b/meta/lib/oe/spdx30_tasks.py index 1841b0de4ae..1629ed69cee 100644 --- a/meta/lib/oe/spdx30_tasks.py +++ b/meta/lib/oe/spdx30_tasks.py @@ -1067,7 +1067,7 @@ def create_rootfs_spdx(d): filenames.sort() for fn in filenames: fpath = Path(dirpath) / fn - if not fpath.is_file() or fpath.is_symlink(): + if fpath.is_symlink() or not fpath.is_file(): continue relpath = str(fpath.relative_to(image_rootfs)) -- 2.47.3