=== mmrazik is now known as mmrazik|otp | ||
=== mmrazik|otp is now known as mmrazik | ||
mgz | morning | 08:11 |
---|---|---|
=== 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 | ||
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:29 |
* fullermd has half of that covered 8-} | 19:30 | |
lifeless | exarkun: I did not. | 19:47 |
lifeless | exarkun: I might be able to. | 19:47 |
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:48 |
fullermd | http://paste.ubuntu.com/1269933/ is a quick block of it. | 19:55 |
exarkun | ah, a keyboard | 20:09 |
exarkun | fullermd: thanks | 20:09 |
exarkun | lifeless: any thoughts? | 20:09 |
lifeless | exarkun: ok | 20:22 |
lifeless | exarkun: can I see your hook ? | 20:22 |
exarkun | lifeless: http://twistedmatrix.com/~exarkun/restart_server.py | 20:22 |
lifeless | exarkun: which line throws the error ? | 20:23 |
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:25 |
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:29 |
lifeless | / branch (may be distinct for distinct verbs, I'd need to check) | 20:30 |
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:32 |
lifeless | so, lightweight=True has no reason to chdir to .. repeatedly | 20:33 |
lifeless | because its using the branch and the branches repository | 20:33 |
lifeless | lightweight=False has to search for a containing repository to reuse for its new branch | 20:34 |
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:35 |
lifeless | exarkun: so, long story short, you probably want to explicitly allow the transport you're going to be using | 20:36 |
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:37 |
exarkun | I don | 20:38 |
exarkun | 't see an API for adding to the allowed transports though | 20:39 |
exarkun | Should I just mutate the thread-local directly? | 20:39 |
lifeless | exarkun: yes, its a public symbol | 20:45 |
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:46 |
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:47 |
=== ccxCZ_ is now known as ccxCZ | ||
lifeless | exarkun: a transport is just a vfs directory | 20:59 |
exarkun | lifeless: Thanks. | 21:22 |
exarkun | lifeless: Regarding the transport.open, I don't see a bzrlib.transport.open function. Maybe get_transport? | 21:22 |
exarkun | Hm, seems not, with the result of get_transport appended to the list, I still get a jail error. | 21:24 |
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:26 |
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:36 |
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 | 21:38 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!