mailing list of musl libc
 help / color / mirror / code / Atom feed
From: u-igbb@aetey.se
To: musl@lists.openwall.com
Subject: Re: be able to break inheritance of LD_LIBRARY_PATH
Date: Fri, 28 Mar 2014 21:07:08 +0000	[thread overview]
Message-ID: <20140328210256.GG8221@example.net> (raw)
In-Reply-To: <20140328194638.GO26358@brightrain.aerifal.cx>

Hello Rich,

Thanks for your answer.

On Fri, Mar 28, 2014 at 03:46:38PM -0400, Rich Felker wrote:
> Why aren't you using RPATH, possibly with a $ORIGIN base? This is a
> lot cleaner/saner than environment variables or invoking the dynamic
> linker explicitly with arguments.

Any hardcoded references make it impossible to update libraries in other
way than "substituting in place" which affects all binaries containing
the hardcoded reference. It is important to be able to run a certain
binary with a certain library without rewriting/replacing either the
former or the latter (both can be needed and used by other parties who
potentially do not expect/agree to any change!).

> > A very nice solution would be the ability to explicitely run a standalone
> > dynamic loader, as implemented in both glibc and uclibc. We are heavily
> > relying on this functionality.
> 
> As others have said, this is already possible, and it's already setup
> to be able to handle option arguments before the command (if you're
> not sure the command name won't begin with a "-", you're supposed to
> put "--" before the command). So it's just a matter of adding the
> options. I haven't checked your patch yet, but the big things to
> consider are:
> 
> - not breaking the current handling of "--"
> 
> - whether --library-path and --preload should override/replace the
>   values obtained from the environment or supplement them, and if the
>   latter, whether they should have higher or lower priority

Sure I am aware of these issues. As much as I can tell I followed
the behaviour of both glibc and uclibc (ignoring LD_LIBRARY_PATH
when --library-path is present).
(--preload is not present in those libraries but I feel it should
behave the same way as --library-path).

> Adding new environment variables that are processed by libc outside of
 ...
> As written this possibly corrupts the environment (e.g. leading to TWO

Sorry for presenting such an ugly example code. The purpose was merely
to explain what I had in mind (which also was wrong per se as I didn't
notice the possibility of adding the loader arguments).

I hope you are more positive to the latter patch (which I consider
being of acceptable quality).

> problem you're trying to solve (and RPATH/$ORIGIN is the best
> solution).

We are certainly thinking about different goals.

Hardcoded references (and even references read from files like
/etc/something if the path to the file is hardcoded into the binary
to be run) make it impossible to perform safe/limited (i.e. with a
constrained impact on the multiple resource consumers) changes in the
bindings between binaries and libraries. In this context RPATH
is hardly a suitable tool, even if combined with $ORIGIN.

Regards,
Rune



  reply	other threads:[~2014-03-28 21:07 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-28 10:42 u-igbb
2014-03-28 12:18 ` orc
2014-03-28 12:52   ` u-igbb
2014-03-28 12:27 ` Alexander Monakov
2014-03-28 13:04   ` u-igbb
2014-03-28 13:17 ` Szabolcs Nagy
2014-03-28 14:00   ` u-igbb
2014-03-28 15:25     ` Szabolcs Nagy
2014-03-28 15:34       ` Alexander Monakov
2014-03-28 16:02     ` PATCH (Re: [musl] be able to break inheritance of LD_LIBRARY_PATH) u-igbb
2014-03-28 16:34 ` be able to break inheritance of LD_LIBRARY_PATH Daniel Cegiełka
2014-03-28 17:50   ` u-igbb
2014-03-28 18:03     ` Daniel Cegiełka
2014-03-28 18:21       ` u-igbb
2014-03-28 19:46 ` Rich Felker
2014-03-28 21:07   ` u-igbb [this message]
2014-03-28 21:48     ` Rich Felker
2014-03-29  7:25       ` u-igbb

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140328210256.GG8221@example.net \
    --to=u-igbb@aetey.se \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).