During unmerge, always verify that the file isn't a symlink before doing chmod.
authorZac Medico <zmedico@gentoo.org>
Mon, 18 Jun 2007 10:26:17 +0000 (10:26 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 18 Jun 2007 10:26:17 +0000 (10:26 -0000)
svn path=/main/trunk/; revision=6867

pym/portage/dbapi/vartree.py

index dcc673c796ff6ff472480fcbef7e4d38ab4cd9b1..68545a53b3ca44fb627e50bf9d75d47f076ba2b1 100644 (file)
@@ -1263,7 +1263,8 @@ class dblink(object):
                                        try:
                                                # Remove permissions to ensure that any hardlinks to
                                                # suid/sgid files are rendered harmless.
-                                               os.chmod(obj, 0)
+                                               if not islink:
+                                                       os.chmod(obj, 0)
                                                os.unlink(obj)
                                        except (OSError, IOError), e:
                                                pass