Hi Carlos,
Carlos O'Donell <carlos@redhat.com> skribis:
Toggle quote (16 lines)
> There are two issues at hand:> * Standard namespace issues (conformance)> * PLT avoidance issues (performance)>> See:> https://sourceware.org/glibc/wiki/Style_and_Conventions#Double-underscore_names_for_public_API_functions>> It is an internal implementation detail that open(2) is being called by> the library, and as such glibc bypasses the ELF interposable symbol> open, and instead calls open directly without this being visible to the> application.>> There are many such cases where we bypass the ELF interposable symbol to> provide standard namespace cleanliness, performance, and so provide consistent> behaviour.
It makes sense to me, thanks for explaining.
Toggle quote (4 lines)
> Yes, in your case this means you cannot override the behaviour of the> interface without using some kind of bind mount, or mount namespace> (to provide an alternate view of the filesystem).
Agreed, unprivileged user namespaces with bind mounts are the preferredsolution; the LD_PRELOAD hack discussed here is for when they’reunavailable and PRoot is too slow.
Toggle quote (4 lines)
> We would have to argue upstream that some minimal subset of the filesystem> access should be interposable via open/close/read/write, but that's going> to get difficult quickly and have significant performance problems.
Yes, understood. (I wasn’t going to suggest it. :-))
Toggle quote (4 lines)
> It would be simpler, IMO, to set LOCPATH and GCONV_PATH appropriately and> alter the runtime behaviour that way. If that doesn't work, perhaps because> of setuid, then we can discuss further.
Yes, setting ‘GCONV_PATH’ in particular seems like something the wrappercould automatically do. The attached patch does that and now Guile runsfine with the ld.so/fakechroot “engine”.
One thing that won’t work is dlopen because our ‘--library-path’argument is computed statically based on the RUNPATH of the wrappedprogram. So for instance if you try to load guile-readline.so fromGuile, it eventually fails because libreadline.so isn’t found(libreadline.so is in the RUNPATH of guile-readline.so, but the loaderuses non-interposable calls here as well.) Probably no simple solutionto that one.
Thanks for your feedback, Carlos!
Ludo’.