From 366009cf6a893ab44c98ff7e7a08b8130d24e98a Mon Sep 17 00:00:00 2001 From: Guy Martin Date: Tue, 5 Feb 2013 00:31:09 -0800 Subject: [PATCH] Make sure shutil.rmtree() isn't passed a symlink Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=455022 Reviewed-by: Matt Turner --- modules/generic_stage_target.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 12921d6c..952fa4ba 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -1143,7 +1143,7 @@ class generic_stage_target(generic_target): "/empty"].split() for x in self.settings[self.settings["spec_prefix"]+"/empty"]: myemp=self.settings["destpath"]+x - if not os.path.isdir(myemp): + if not os.path.isdir(myemp) or os.path.islink(myemp): print x,"not a directory or does not exist, skipping 'empty' operation." continue print "Emptying directory",x -- 2.26.2