# HG changeset patch # User Paul Crowley # Date 1208346491 -3600 # Node ID 6fc5eab8ae58d2f709ca34fa101624aa5c50a614 # Parent dcd195f3e52c8ef6dd63638067001a689529526f disallow dots diff -r dcd195f3e52c -r 6fc5eab8ae58 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: