summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-21 02:20:17 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-21 02:20:17 +0000
commit9ff995078c534eca001138915a5e665380974803 (patch)
tree7e3df3f4deeb00a8a5de270bcd7896ca0997b9b1 /pym
parent61bf1aa26dbfbaefc55afed391110831185766c2 (diff)
downloadportage-9ff995078c534eca001138915a5e665380974803.tar.gz
portage-9ff995078c534eca001138915a5e665380974803.tar.bz2
portage-9ff995078c534eca001138915a5e665380974803.zip
In dblink._security_check(), use os.path.realpath to make sure that the same path isn't counted twice. (trunk r6894)
svn path=/main/branches/2.1.2/; revision=6895
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 054435bff..fe99c0c9b 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -7322,6 +7322,7 @@ class dblink:
for dblnk in installed_instances:
file_paths.update(dblnk.getcontents())
inode_map = {}
+ real_paths = set()
for path in file_paths:
try:
s = os.lstat(path)
@@ -7330,8 +7331,13 @@ class dblink:
raise
del e
continue
- if stat.S_ISREG(s.st_mode) and \
- s.st_nlink > 1 and \
+ if not stat.S_ISREG(s.st_mode):
+ continue
+ path = os.path.realpath(path)
+ if path in real_paths:
+ continue
+ real_paths.add(path)
+ if s.st_nlink > 1 and \
s.st_mode & (stat.S_ISUID | stat.S_ISGID):
k = (s.st_dev, s.st_ino)
inode_map.setdefault(k, []).append((path, s))