aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Quaresma <quaresma.jose@gmail.com>2022-07-19 10:39:02 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-07-28 11:53:10 +0100
commit7236488b898309ec5f1880936ddae22a28ccf5d3 (patch)
tree5d6c3dfc4759b0defbff782ec5ba22b8a34dd07f
parent68f4ce662cad28fed739900addbdee949ad3c1e8 (diff)
downloadbitbake-7236488b898309ec5f1880936ddae22a28ccf5d3.tar.gz
bb/utils: remove: check the path again the expand python glob
When we call the remove with recurse=True we first check if the remove operation is safe in _check_unsafe_delete_path. But the check is been done on the path instaed of the expanded python glog. Signed-off-by: Jose Quaresma <jose.quaresma@foundries.io> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
-rw-r--r--lib/bb/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index d11da978d..512cc4eb7 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -692,8 +692,8 @@ def remove(path, recurse=False, ionice=False):
return
if recurse:
for name in glob.glob(path):
- if _check_unsafe_delete_path(path):
- raise Exception('bb.utils.remove: called with dangerous path "%s" and recurse=True, refusing to delete!' % path)
+ if _check_unsafe_delete_path(name):
+ raise Exception('bb.utils.remove: called with dangerous path "%s" and recurse=True, refusing to delete!' % name)
# shutil.rmtree(name) would be ideal but its too slow
cmd = []
if ionice: