For bug #182157, never chmod 0 symlinks before unlinking them.
authorZac Medico <zmedico@gentoo.org>
Fri, 15 Jun 2007 20:06:54 +0000 (20:06 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 15 Jun 2007 20:06:54 +0000 (20:06 -0000)
svn path=/main/trunk/; revision=6848

pym/portage/dbapi/vartree.py

index 2d3f4428365ec492aa0cd0004ce5cd620f917073..182c129c4a4eea8e12c3465b63e32a0bb7cb922e 100644 (file)
@@ -1199,7 +1199,7 @@ class dblink(object):
                                        try:
                                                # Remove permissions to ensure that any hardlinks to
                                                # suid/sgid files are rendered harmless.
-                                               if statobj:
+                                               if statobj and not islink:
                                                        os.chmod(obj, 0)
                                                os.unlink(obj)
                                        except EnvironmentError, e: