~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to contrib/bzr_ssh_path_limiter

  • Committer: John Arbash Meinel
  • Date: 2006-09-12 20:46:42 UTC
  • mto: This revision was merged to the branch mainline in revision 2071.
  • Revision ID: john@arbash-meinel.com-20060912204642-91599869cc863f07
Cleanup, deprecated, and get the tests passing again.

bzrlib.builtins.merge is heavily used by the test suite, though it is
really the wrong place for a function like that.
lazy imports work badly with doctests, but so far none of the doc tested
modules had anything worth testing in that fashion.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
 
 
3
 
# Inspired by Rusty and the hg_ssh script:
4
 
# http://www.selenic.com/repo/index.cgi/hg-stable/file/tip/contrib/hg-ssh
5
 
#
6
 
# Use in ~/.ssh/authorized_keys like:
7
 
#
8
 
# command="bzr_ssh_path_limiter /home/foo/code" ssh-rsa ...
9
 
 
10
 
import os, sys
11
 
 
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')
15
 
 
16
 
sys.stderr.write('Illegal command: %s\n' % (orig_cmd,))
17
 
sys.exit(1)
18