LD_PRELOAD work in progress

Michael Terry michael.terry at canonical.com
Tue Mar 17 12:45:15 UTC 2015


On Wed, Feb 25, 2015 at 6:23 AM, Adam Conrad <adconrad at ubuntu.com> wrote:

> On Tue, Feb 24, 2015 at 03:50:16PM -0800, Steve Langasek wrote:
> >
> > Cc:ing Adam Conrad.  Adam, do you know if the kind of LD_PRELOAD
> described
> > here will work on glibc nowadays, or if there are gaps?
>
> As Martin said, this works fine for things like fakechroot, but for a
> value of "fine" that I'm not sure I'd want to see in production code.
>
> I feel like I'm missing (a lot) of context here, but what problem are
> we trying to solve with LD_PRELOAD and dynamically faking paths that
> we couldn't be solving in a less insane fashion?
>

There is a desire to easily suck in existing code in .deb packages into a
snap (maybe your program uses an Ubuntu library, or depends on a command
line program, etc.)

Unfortunately, all that existing code frequently contains paths hardcoded
at compile time (both for external executables and data).

So in order to handle such hardcoded paths, we need some sort of path
redirection.  Like overlayfs or an LD_PRELOAD trick.

So LD_PRELOAD was seen as a possible way forward while overlayfs support is
finished.  In theory it should be mostly sufficient...  So I'm testing the
theory a little bit.

-- 
-mt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snappy-devel/attachments/20150317/b5165186/attachment.html>


More information about the snappy-devel mailing list