Sophie

Sophie

distrib > Mageia > 6 > x86_64 > media > core-updates > by-pkgid > c8cd3129d93981aadc6c5112e01e2495 > files > 2507

bzr-2.7.0-1.2.mga6.x86_64.rpm

#!/usr/bin/python

# Inspired by Rusty and the hg_ssh script:
# http://www.selenic.com/repo/index.cgi/hg-stable/file/tip/contrib/hg-ssh
#
# Use in ~/.ssh/authorized_keys like:
#
# command="bzr_ssh_path_limiter /home/foo/code" ssh-rsa ...

import os, sys

orig_cmd = os.getenv('SSH_ORIGINAL_COMMAND', '?')
if orig_cmd == 'bzr serve --inet --directory=/ --allow-writes':
    os.execlp('bzr', 'bzr', '--no-plugins', 'serve', '--inet', '--directory=' + sys.argv[1], '--allow-writes')

sys.stderr.write('Illegal command: %s\n' % (orig_cmd,))
sys.exit(1)