From: Guy Martin Date: Tue, 5 Feb 2013 08:31:09 +0000 (-0800) Subject: Make sure shutil.rmtree() isn't passed a symlink X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=366009cf6a893ab44c98ff7e7a08b8130d24e98a;p=catalyst.git Make sure shutil.rmtree() isn't passed a symlink Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=455022 Reviewed-by: Matt Turner --- 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