[08:11] <mgz> morning
[19:29] <exarkun> hi, I wonder if anyone who knows about the smart server jail saw my question in the logs from the weekend and can shed some light on my issue
[19:30]  * fullermd has half of that covered   8-}
[19:47] <lifeless> exarkun: I did not.
[19:47] <lifeless> exarkun: I might be able to.
[19:48] <fullermd> lifeless: He was doing something with writing some file in a hook, that complained about jailbreaking.
[19:48] <fullermd> I can probably dig up the logs...
[19:55] <fullermd> http://paste.ubuntu.com/1269933/  is a quick block of it.
[20:09] <exarkun> ah, a keyboard
[20:09] <exarkun> fullermd: thanks
[20:09] <exarkun> lifeless: any thoughts?
[20:22] <lifeless> exarkun: ok
[20:22] <lifeless> exarkun: can I see your hook ?
[20:22] <exarkun> lifeless: http://twistedmatrix.com/~exarkun/restart_server.py
[20:23] <lifeless> exarkun: which line throws the error ?
[20:25] <exarkun> oh, codepad.org is broken :(  http://pastebin.com/KkUbcrAJ
[20:25] <exarkun> line 30, params.branch.create_checkout(to_location=checkout.path, lightweight=False)
[20:25] <exarkun> lightweight=True succeeds
[20:29] <lifeless> ok
[20:29] <lifeless> so here is what I suspect is happening
[20:29] <lifeless> firstly the jail
[20:29] <lifeless> what happens is that code in the server runs with a transport url like chroot-1234://foo
[20:29] <lifeless> where // is rooted at the repository
[20:30] <lifeless>  / branch (may be distinct for distinct verbs, I'd need to check)
[20:32] <lifeless> this is so that code can't accidentally traverse up outside the repository
[20:32] <lifeless> e.g. due to bugs
[20:32] <lifeless> its only a soft chroot through
[20:32] <lifeless> you can escape it by opening a new transport on local disk / memory / wherever
[20:32] <lifeless> or by poking through the chroot object innards
[20:33] <lifeless> so, lightweight=True has no reason to chdir to .. repeatedly
[20:33] <lifeless> because its using the branch and the branches repository
[20:34] <lifeless> lightweight=False has to search for a containing repository to reuse for its new branch
[20:35] <lifeless> exarkun: if you look in bzrlib/smart/request.py you'll see that the pre_open_hook has a list of allowed transports, thats thread specific
[20:35] <lifeless> exarkun: and knows to translate file:// into any of those transports (by mapping across).
[20:36] <lifeless> exarkun: so, long story short, you probably want to explicitly allow the transport you're going to be using
[20:37] <lifeless> the jail is entirely there to prevent awfuck moments when you delete your hard drive due to a badly written hook that assumes its running in a user context, for instance.
[20:38] <exarkun> I don
[20:39] <exarkun> 't see an API for adding to the allowed transports though
[20:39] <exarkun> Should I just mutate the thread-local directly?
[20:45] <lifeless> exarkun: yes, its a public symbol
[20:46] <lifeless> exarkun: bzrlib.smart.request.jail_info.transports.append(transport.open('file:///home/foo'))
[20:46] <lifeless> or whatever
[20:46] <exarkun> hee hee, "symbol"
[20:46] <lifeless> attribute
[20:46] <lifeless> doohicky
[20:46] <lifeless> thingamy
[20:47] <exarkun> file:///home/foo doesn't have to be a bzr branch or repository or anything?  I don't really know what a bzrlib transport is.
[20:59] <lifeless> exarkun: a transport is just a vfs directory
[21:22] <exarkun> lifeless: Thanks.
[21:22] <exarkun> lifeless: Regarding the transport.open, I don't see a bzrlib.transport.open function.  Maybe get_transport?
[21:24] <exarkun> Hm, seems not, with the result of get_transport appended to the list, I still get a jail error.
[21:26] <exarkun> lifeless: Once I add get_transport('file:///home/foo'), the error just changes to be about file:///home/
[21:26] <exarkun> I guess I could just add file:///
[21:36] <lifeless> exarkun: there is/was a standalone=True you could pass I think
[21:36] <lifeless> which would tell it not to seek a containing repository
[21:38] <exarkun> I used file:/// it works :/
[21:38] <exarkun> thus ends my interest in the matter for the time being
[21:38] <exarkun> thanks again for getting me there
[21:38] <lifeless> exarkun: np