Make sure shutil.rmtree() isn't passed a symlink
authorGuy Martin <gmsoft@gentoo.org>
Tue, 5 Feb 2013 08:31:09 +0000 (00:31 -0800)
committerMatt Turner <mattst88@gmail.com>
Tue, 5 Feb 2013 08:34:02 +0000 (00:34 -0800)
Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=455022
Reviewed-by: Matt Turner <mattst88@gentoo.org>
modules/generic_stage_target.py

index 12921d6ce025f129eeae1e0711a052da8abf1deb..952fa4babc8fec1b89f997474ce67f86032cbef6 100644 (file)
@@ -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