For bug #182157, never chmod 0 symlinks before unlinking them. (branches/2.1.2 r6849)
authorZac Medico <zmedico@gentoo.org>
Mon, 30 Jul 2007 04:14:21 +0000 (04:14 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 30 Jul 2007 04:14:21 +0000 (04:14 -0000)
svn path=/main/branches/2.1.2.9/; revision=7464

pym/portage.py

index 64c2eecbda92c5f2ea7d5c59ad6a66df64167e18..5bc2f22d8ee5653fbe54b97d50c6d693e38edf94 100644 (file)
@@ -7189,7 +7189,8 @@ class dblink:
                                                writemsg_stdout("--- !md5   %s %s\n" % ("obj", obj))
                                                continue
                                        try:
-                                               if statobj.st_mode & (stat.S_ISUID | stat.S_ISGID):
+                                               if not islink and \
+                                                       statobj.st_mode & (stat.S_ISUID | stat.S_ISGID):
                                                        # Always blind chmod 0 before unlinking to avoid race conditions.
                                                        os.chmod(obj, 0000)
                                                        if statobj.st_nlink > 1: