diff options
author | Yi Zhao <yi.zhao@eng.windriver.com> | 2024-10-11 17:19:35 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-10-11 15:57:45 +0100 |
commit | 8028c989ccfc363e437da80c4791fabd7977d99b (patch) | |
tree | 9885c1e36638cc1482e730c6cc327bf7bf75b310 /scripts/lib | |
parent | f8d8f08f5024f900d0260d78dd215c621ae15591 (diff) | |
download | poky-8028c989ccfc363e437da80c4791fabd7977d99b.tar.gz |
wic/rootfs.py: allow --exclude-path option to exclude symlinks
Currently, if we specify a symbolic link in --exclude-path option,
we will get the following error in do_image_wic:
ERROR: --exclude-path: Must point inside the rootfs: usr/bin/hello.link
This is because it uses os.path.realpath to eliminate symbolic links. To
exclude symbolic links, use os.path.abspath instead of os.path.realpath.
(From OE-Core rev: 42e829ac1e9d74646b6dfb327b18b15f6b0df60b)
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib')
-rw-r--r-- | scripts/lib/wic/plugins/source/rootfs.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py index c990143c0d..06fce06bb1 100644 --- a/scripts/lib/wic/plugins/source/rootfs.py +++ b/scripts/lib/wic/plugins/source/rootfs.py | |||
@@ -41,7 +41,7 @@ class RootfsPlugin(SourcePlugin): | |||
41 | # Disallow climbing outside of parent directory using '..', | 41 | # Disallow climbing outside of parent directory using '..', |
42 | # because doing so could be quite disastrous (we will delete the | 42 | # because doing so could be quite disastrous (we will delete the |
43 | # directory, or modify a directory outside OpenEmbedded). | 43 | # directory, or modify a directory outside OpenEmbedded). |
44 | full_path = os.path.realpath(os.path.join(rootfs_dir, path)) | 44 | full_path = os.path.abspath(os.path.join(rootfs_dir, path)) |
45 | if not full_path.startswith(os.path.realpath(rootfs_dir)): | 45 | if not full_path.startswith(os.path.realpath(rootfs_dir)): |
46 | logger.error("%s: Must point inside the rootfs: %s" % (cmd, path)) | 46 | logger.error("%s: Must point inside the rootfs: %s" % (cmd, path)) |
47 | sys.exit(1) | 47 | sys.exit(1) |