On Sun, Nov 10, 2019 at 11:37 PM Caveman Al Toraboran
<toraboracave...@protonmail.com> wrote:
>
> hi - is it possible to have some kind of fancy links that
> know the name of the process that is trying to access
> it, and based on its name, it links it to a file?

Yes, and that's used pretty extensively in busybox. Symlinks named any
of its tools that point to it directly call into *that* tool.

> i think if we have this, we can solve slotting in a simpler
> way.  e.g. we install libs in their own non-conflicting
> locations, and then install for them such fancy sym links
> with access that routes accessing processes to the right
> version of the lib.

I'm not entirely sure about the library level. Your goal sounds like
one link to many library versions instead of many links to one
library. A symlink itself can only point at one thing, so the
filesystem level can't do that. So you would have to have a shim
library that gets loaded, then loads the version the calling process
needs... based on either an exhaustive table of the mappings of every
binary to the versions they need, or some other magic.You wouldn't be
able to just pick any version of a library and hand it back to a
process, since major versions on libraries tend to break the
interfaces they present, so you would end up having a 1:1 mapping of
any particular binary calling a singular library version. That already
happens based on the linker, and even works for less specific
versioning in many cases with symlinks from, say, libc.so.6 and
libc.so.6.2 pointing to libc.so.6.2.13 (which is actually a many links
to one library technique that's already used). To change what
interface a calling process *can* work with will require rebuilding it
against the new major version of the library, and if it's one of those
circular situations where it's part of the build process, you have to
have both the old and new library available (one of the reason slots
exist). The binary itself should contain enough detail to load the
version *it* needs already, and then should be requesting that from
the dynamic linker already...

-- 
Poison [BLX]
Joshua M. Murphy

Reply via email to