3
# Inspired by Rusty and the hg_ssh script:
4
# http://www.selenic.com/repo/index.cgi/hg-stable/file/tip/contrib/hg-ssh
6
# Use in ~/.ssh/authorized_keys like:
8
# command="bzr_ssh_path_limiter /home/foo/code" ssh-rsa ...
12
orig_cmd = os.getenv('SSH_ORIGINAL_COMMAND', '?')
13
if orig_cmd == 'bzr serve --inet --directory=/ --allow-writes':
14
os.execlp('bzr', 'bzr', '--no-plugins', 'serve', '--inet', '--directory=' + sys.argv[1], '--allow-writes')
16
sys.stderr.write('Illegal command: %s\n' % (orig_cmd,))