--- a/src/hg-ssh Mon Oct 12 16:25:02 2009 +0100
+++ b/src/hg-ssh Mon Oct 12 16:52:06 2009 +0100
@@ -89,9 +89,11 @@
if os.path.isfile(f):
ruleset.rules.readfile(f)
-cmd = os.environ.get('SSH_ORIGINAL_COMMAND', '')
+cmd = os.environ.get('SSH_ORIGINAL_COMMAND', None)
try:
- if cmd.startswith('hg -R ') and cmd.endswith(' serve --stdio'):
+ if cmd is None:
+ fail("direct logins on the hg account prohibited")
+ elif cmd.startswith('hg -R ') and cmd.endswith(' serve --stdio'):
repo = getrepo("read", cmd[6:-14])
if not os.path.isdir(repo + "/.hg"):
fail("no such repository %s" % repo)
@@ -104,8 +106,6 @@
if d != "" and not os.path.isdir(d):
os.makedirs(d)
dispatch.dispatch(['init', repo])
- elif cmd == "":
- fail("direct logins on the hg account prohibited ")
else:
fail("illegal command %r" % cmd)
except ruleset.AccessException: