summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/wic/plugins/source/rootfs.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/lib/wic/plugins/source/rootfs.py b/scripts/lib/wic/plugins/source/rootfs.py
index 85c634f8a1..247f61ff7c 100644
--- a/scripts/lib/wic/plugins/source/rootfs.py
+++ b/scripts/lib/wic/plugins/source/rootfs.py
@@ -136,7 +136,6 @@ class RootfsPlugin(SourcePlugin):
136 sys.exit(1) 136 sys.exit(1)
137 137
138 full_path = os.path.realpath(os.path.join(new_rootfs, path)) 138 full_path = os.path.realpath(os.path.join(new_rootfs, path))
139
140 # Disallow climbing outside of parent directory using '..', 139 # Disallow climbing outside of parent directory using '..',
141 # because doing so could be quite disastrous (we will delete the 140 # because doing so could be quite disastrous (we will delete the
142 # directory). 141 # directory).
@@ -144,6 +143,9 @@ class RootfsPlugin(SourcePlugin):
144 logger.error("'%s' points to a path outside the rootfs" % orig_path) 143 logger.error("'%s' points to a path outside the rootfs" % orig_path)
145 sys.exit(1) 144 sys.exit(1)
146 145
146 if not os.path.lexists(full_path):
147 continue
148
147 if path.endswith(os.sep): 149 if path.endswith(os.sep):
148 # Delete content only. 150 # Delete content only.
149 for entry in os.listdir(full_path): 151 for entry in os.listdir(full_path):