* [bitbake-devel][PATCH] bb/utils: remove: check the path again the expand python glob
@ 2022-07-19 9:39 Jose Quaresma
0 siblings, 0 replies; only message in thread
From: Jose Quaresma @ 2022-07-19 9:39 UTC (permalink / raw)
To: bitbake-devel; +Cc: Jose Quaresma
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>
---
lib/bb/utils.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/bb/utils.py b/lib/bb/utils.py
index 3abc4938..19ed68ea 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:
--
2.37.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-19 9:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19 9:39 [bitbake-devel][PATCH] bb/utils: remove: check the path again the expand python glob Jose Quaresma
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.