aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Quaresma <quaresma.jose@gmail.com>2022-09-13 04:26:42 -1000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-09-16 17:52:26 +0100
commit280ea5a776436eab7e664fccea2df2e7ce47e586 (patch)
tree0107a9b674837ba7830279728887e8813c2960f1
parentb7967aa086ee3f3716a17431af0eef05452fb46f (diff)
downloadbitbake-280ea5a776436eab7e664fccea2df2e7ce47e586.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> (cherry picked from commit 7236488b898309ec5f1880936ddae22a28ccf5d3) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 298017657..e92d5feb2 100644
--- a/lib/bb/utils.py
+++ b/lib/bb/utils.py
@@ -694,8 +694,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: