diff options
| author | Peter Marko <peter.marko@siemens.com> | 2022-08-11 14:35:13 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-08-28 07:51:30 +0100 |
| commit | df99f61e05c47d037118cb87aae3ef051c1e9e34 (patch) | |
| tree | 5f53f835d1f2a552462ebe078b7df17629973d7c /meta/classes/create-spdx.bbclass | |
| parent | 4084c93c6af9bfaa25075e3c3057788a8b51ad71 (diff) | |
| download | poky-df99f61e05c47d037118cb87aae3ef051c1e9e34.tar.gz | |
create-spdx: handle links to inaccessible locations
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.
(From OE-Core rev: 9661656987e547290cecb94cbf9b34335ae9d903)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit e105befbe4ee0d85e94c2048a744f0373e2dbcdf)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/create-spdx.bbclass')
| -rw-r--r-- | meta/classes/create-spdx.bbclass | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/create-spdx.bbclass b/meta/classes/create-spdx.bbclass index ae484328fb..d735f20c20 100644 --- a/meta/classes/create-spdx.bbclass +++ b/meta/classes/create-spdx.bbclass | |||
| @@ -210,7 +210,7 @@ def add_package_files(d, doc, spdx_pkg, topdir, get_spdxid, get_types, *, archiv | |||
| 210 | filepath = Path(subdir) / file | 210 | filepath = Path(subdir) / file |
| 211 | filename = str(filepath.relative_to(topdir)) | 211 | filename = str(filepath.relative_to(topdir)) |
| 212 | 212 | ||
| 213 | if filepath.is_file() and not filepath.is_symlink(): | 213 | if not filepath.is_symlink() and filepath.is_file(): |
| 214 | spdx_file = oe.spdx.SPDXFile() | 214 | spdx_file = oe.spdx.SPDXFile() |
| 215 | spdx_file.SPDXID = get_spdxid(file_counter) | 215 | spdx_file.SPDXID = get_spdxid(file_counter) |
| 216 | for t in get_types(filepath): | 216 | for t in get_types(filepath): |
