diff mercurial/localrepo.py @ 5158:d316124ebbea

Make audit_path more stringent. The following properties of a path are now checked for: - under top-level .hg - starts at the root of a windows drive - contains ".." - traverses a symlink (e.g. a/symlink_here/b) - inside a nested repository If any of these is true, the path is rejected. The check for traversing a symlink is arguably stricter than necessary; perhaps we should be checking for symlinks that point outside the repository.
author Bryan O'Sullivan <bos@serpentine.com>
date Fri, 10 Aug 2007 10:46:03 -0700
parents 2ffe3e2a1ac2
children 012dbf88b9b2
line wrap: on
line diff
--- a/mercurial/localrepo.py	Thu Aug 09 20:16:00 2007 -0700
+++ b/mercurial/localrepo.py	Fri Aug 10 10:46:03 2007 -0700
@@ -69,7 +69,8 @@
             self.encodefn = lambda x: x
             self.decodefn = lambda x: x
             self.spath = self.path
-        self.sopener = util.encodedopener(util.opener(self.spath), self.encodefn)
+        self.sopener = util.encodedopener(util.opener(self.spath),
+                                          self.encodefn)
 
         self.ui = ui.ui(parentui=parentui)
         try: