~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/wsgi.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-03-28 06:58:22 UTC
  • mfrom: (2379.2.3 hpss-chroot)
  • Revision ID: pqm@pqm.ubuntu.com-20070328065822-999550a858a3ced3
(robertc) Fix chroot urls to not expose the url of the transport they are protecting, allowing regular url operations to work on them. (Robert Collins, Andrew Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
        # accidentally let people access locations they shouldn't.
95
95
        # e.g. consider a smart server request for "get /etc/passwd" or
96
96
        # something.
97
 
        self.backing_transport = chroot.ChrootTransportDecorator(
98
 
            'chroot+' + backing_transport.base, _decorated=backing_transport)
 
97
        self.chroot_server = chroot.ChrootServer(backing_transport)
 
98
        self.chroot_server.setUp()
 
99
        self.backing_transport = get_transport(self.chroot_server.get_url())
 
100
        # While the chroot server can technically be torn down at this point,
 
101
        # as all it does is remove the scheme registration from transport's 
 
102
        # protocol dictionary, we don't *just in case* there are parts of 
 
103
        # bzrlib that will invoke 'get_transport' on urls rather than cloning
 
104
        # around the existing transport.
 
105
        #self.chroot_server.tearDown()
99
106
 
100
107
    def __call__(self, environ, start_response):
101
108
        """WSGI application callable."""
124
131
        return [response_data]
125
132
 
126
133
    def make_request(self, transport, write_func):
127
 
        return smart.SmartServerRequestProtocolOne(transport, write_func)
 
134
        return protocol.SmartServerRequestProtocolOne(transport, write_func)