Show More
@@ -83,16 +83,17 b' class pathauditor(object):' | |||
|
83 | 83 | parts.pop() |
|
84 | 84 | normparts.pop() |
|
85 | 85 | prefixes = [] |
|
86 | while parts: | |
|
87 | prefix = os.sep.join(parts) | |
|
88 | normprefix = os.sep.join(normparts) | |
|
86 | # It's important that we check the path parts starting from the root. | |
|
87 | # This means we won't accidentaly traverse a symlink into some other | |
|
88 | # filesystem (which is potentially expensive to access). | |
|
89 | for i in range(len(parts)): | |
|
90 | prefix = os.sep.join(parts[:i + 1]) | |
|
91 | normprefix = os.sep.join(normparts[:i + 1]) | |
|
89 | 92 | if normprefix in self.auditeddir: |
|
90 |
|
|
|
93 | continue | |
|
91 | 94 | if self._realfs: |
|
92 | 95 | self._checkfs(prefix, path) |
|
93 | 96 | prefixes.append(normprefix) |
|
94 | parts.pop() | |
|
95 | normparts.pop() | |
|
96 | 97 | |
|
97 | 98 | self.audited.add(normpath) |
|
98 | 99 | # only add prefixes to the cache after checking everything: we don't |
General Comments 0
You need to be logged in to leave comments.
Login now