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