Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1408311651080.5292@monopod.intra.ispras.ru>
Date: Sun, 31 Aug 2014 17:14:26 +0400 (MSK)
From: Alexander Monakov <amonakov@...ras.ru>
To: musl@...ts.openwall.com
Subject: Re: Retention of LD_LIBRARY_PATH

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

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.