diff -r 97a8fe72a35e -r 107d28ce67f5 src/hg-ssh --- a/src/hg-ssh Fri Dec 18 13:25:45 2009 +0000 +++ b/src/hg-ssh Sat Dec 19 19:21:41 2009 +0000 @@ -1,14 +1,4 @@ #!/usr/bin/env python -# -# Copyright 2008-2009 LShift Ltd -# Copyright 2005-2007 by Intevation GmbH -# Authors: -# Paul Crowley -# Thomas Arendsen Hein -# with ideas from Mathieu PASQUET -# -# This software may be used and distributed according to the terms -# of the GNU General Public License, incorporated herein by reference. """ hg-ssh - limit access to hg repositories reached via ssh. Part of @@ -55,7 +45,7 @@ def getrepo(op, repo): # First canonicalise, then check the string, then the rules # and finally the filesystem. - repo = repo.rstrip("/") + repo = repo.strip().rstrip("/") if len(repo) == 0: fail("path to repository seems to be empty") if repo.startswith("/"): @@ -69,6 +59,9 @@ config.initExe() +for k,v in config.getEnv(): + os.environ[k.upper()] = v + if len(sys.argv) == 3 and sys.argv[1] == "--base64": ruleset.rules.set(user = base64.b64decode(sys.argv[2])) elif len(sys.argv) == 2: @@ -77,9 +70,6 @@ fail("hg-ssh wrongly called, is authorized_keys corrupt? (%s)" % sys.argv) -for k,v in config.getEnv(): - os.environ[k] = v - os.chdir(config.getReposPath()) for f in config.getAccessPaths():