Rev 3813: Add contrib/bzr_ssh_path_limiter. (Andrew Bennetts) in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Fri Oct 31 03:15:41 GMT 2008


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 3813
revision-id: pqm at pqm.ubuntu.com-20081031031538-0ih0zi2owevf6fwu
parent: pqm at pqm.ubuntu.com-20081030235342-3ttqulydt0irv350
parent: andrew.bennetts at canonical.com-20081030010559-tumoefnsmhg4snxo
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Fri 2008-10-31 03:15:38 +0000
message:
  Add contrib/bzr_ssh_path_limiter. (Andrew Bennetts)
added:
  contrib/bzr_ssh_path_limiter   bzr_ssh_path_limiter-20081030010544-xjhl0y2i6wyloz8q-1
    ------------------------------------------------------------
    revno: 3806.1.1
    revision-id: andrew.bennetts at canonical.com-20081030010559-tumoefnsmhg4snxo
    parent: pqm at pqm.ubuntu.com-20081029070146-p1cqjt23zctbpg51
    committer: Andrew Bennetts <andrew.bennetts at canonical.com>
    branch nick: contrib
    timestamp: Thu 2008-10-30 12:05:59 +1100
    message:
      Add contrib/bzr_ssh_path_limiter.
    added:
      contrib/bzr_ssh_path_limiter   bzr_ssh_path_limiter-20081030010544-xjhl0y2i6wyloz8q-1
=== added file 'contrib/bzr_ssh_path_limiter'
--- a/contrib/bzr_ssh_path_limiter	1970-01-01 00:00:00 +0000
+++ b/contrib/bzr_ssh_path_limiter	2008-10-30 01:05:59 +0000
@@ -0,0 +1,18 @@
+#!/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)
+




More information about the bazaar-commits mailing list