Commit d52e3826cd4 by Yuya Nishihara

pathutil: resurrect comment about path auditing order

It was removed at 51c86c6167c1, but expensive symlink traversal isn't the
only reason we should walk path components from the root.
parent bed8d08cfcb
Pipeline #2992 failed with stage
in 91 minutes 42 seconds
......@@ -100,8 +100,10 @@ class pathauditor(object):
parts.pop()
normparts.pop()
# It's important that we check the path parts starting from the root.
# This means we won't accidentally traverse a symlink into some other
# filesystem (which is potentially expensive to access).
# We don't want to add "foo/bar/baz" to auditeddir before checking if
# there's a "foo/.hg" directory. This also means we won't accidentally
# traverse a symlink into some other filesystem (which is potentially
# expensive to access).
for i in range(len(parts)):
prefix = pycompat.ossep.join(parts[: i + 1])
normprefix = pycompat.ossep.join(normparts[: i + 1])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment