From fe2c27108af37d653d1a06367d94084081ff9898 Mon Sep 17 00:00:00 2001 From: Jose Quaresma Date: Tue, 13 Sep 2022 04:26:42 -1000 Subject: bitbake: 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. (Bitbake rev: 280ea5a776436eab7e664fccea2df2e7ce47e586) Signed-off-by: Jose Quaresma Signed-off-by: Alexandre Belloni (cherry picked from commit 7236488b898309ec5f1880936ddae22a28ccf5d3) Signed-off-by: Steve Sakoman Signed-off-by: Richard Purdie --- bitbake/lib/bb/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bitbake') diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py index 298017657a..e92d5feb2e 100644 --- a/bitbake/lib/bb/utils.py +++ b/bitbake/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: -- cgit v1.2.3-54-g00ecf