disallow dots
authorPaul Crowley <paul@lshift.net>
Wed, 16 Apr 2008 12:48:11 +0100
changeset 5 6fc5eab8ae58
parent 4 dcd195f3e52c
child 6 505d4789f91c
disallow dots
hg-ssh
--- a/hg-ssh	Wed Apr 16 12:43:21 2008 +0100
+++ b/hg-ssh	Wed Apr 16 12:48:11 2008 +0100
@@ -33,7 +33,9 @@
     sys.stderr.write(message + "\n")
     sys.exit(-1)
 
-allowedchars = "A-Za-z0-9_.-"
+# Note that this currently disallows dots in path components - if you change it
+# to allow them ensure that "." and ".." are disallowed in path components.
+allowedchars = "A-Za-z0-9_-"
 goodpathre = re.compile("([%s]+/)*[%s]+$" % (allowedchars, allowedchars))
 def goodpath(path):
     if goodpathre.match(path) is None: