mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Alexander Monakov <amonakov@ispras.ru>
To: musl@lists.openwall.com
Subject: Re: Retention of LD_LIBRARY_PATH
Date: Sun, 31 Aug 2014 17:14:26 +0400 (MSK)	[thread overview]
Message-ID: <alpine.LNX.2.00.1408311651080.5292@monopod.intra.ispras.ru> (raw)
In-Reply-To: <20140831124152.GU12888@brightrain.aerifal.cx>

On Sun, 31 Aug 2014, Rich Felker wrote:

> On Sun, Aug 31, 2014 at 02:25:18PM +0400, Alexander Monakov wrote:
> > The dynamic loader in musl retains a pointer to LD_LIBRARY_PATH from the
> > initial environment, which is exposed to the application via 'char **environ'.
> > Changes to environ may cause subsequent calls to dlopen to use different
> > search paths, but modifications via setenv and putenv do not have such effect.
> 
> "Any application that directly modifies the pointers to which the
> environ variable points has undefined behavior."

This doesn't seem to cover pointed-to character data (which is 'char' rather
than 'const char') without modifying pointers.  Apologies for the sloppy
wording in my previous email: 'changes to environ' should have been 'changes
to LD_LIBRARY_PATH string value (but not location) via environ'.

So a conforming application can still notice a difference.  I don't feel it's
a big problem (non-const char **environ is very iffy to me), but I thought
pointing out this discrepancy wouldn't hurt.

Thanks for your explanations.

Alexander


      reply	other threads:[~2014-08-31 13:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-31 10:25 Alexander Monakov
2014-08-31 12:41 ` Rich Felker
2014-08-31 13:14   ` Alexander Monakov [this message]

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=alpine.LNX.2.00.1408311651080.5292@monopod.intra.ispras.ru \
    --to=amonakov@ispras.ru \
    --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).