From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4738 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: be able to break inheritance of LD_LIBRARY_PATH Date: Fri, 28 Mar 2014 17:48:44 -0400 Message-ID: <20140328214844.GS26358@brightrain.aerifal.cx> References: <20140328104208.GZ8221@example.net> <20140328194638.GO26358@brightrain.aerifal.cx> <20140328210256.GG8221@example.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1396043328 20935 80.91.229.3 (28 Mar 2014 21:48:48 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Mar 2014 21:48:48 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4742-gllmg-musl=m.gmane.org@lists.openwall.com Fri Mar 28 22:48:58 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1WTee1-0007gV-Oa for gllmg-musl@plane.gmane.org; Fri, 28 Mar 2014 22:48:57 +0100 Original-Received: (qmail 19587 invoked by uid 550); 28 Mar 2014 21:48:56 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 19579 invoked from network); 28 Mar 2014 21:48:56 -0000 Content-Disposition: inline In-Reply-To: <20140328210256.GG8221@example.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:4738 Archived-At: On Fri, Mar 28, 2014 at 09:07:08PM +0000, u-igbb@aetey.se wrote: > 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. This is exactly the problem $ORIGIN exists to solve. Used in RPATH, '$ORIGIN' or '${ORIGIN}' expands to the directory component of the pathname of the executable or library the RPATH tag resides in. So you can use things like RPATH=$ORIGIN/../lib or RPATH=$ORIGIN or similar. > > - 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). I'm definitely fine with adding --library-path. The intent was always to add options compatible with or at least similar to those used by other dynamic loaders; that's why I added the "--" handling early on so that adding options would not be a feature regression (breaking the ability to run programs whose names start with "-". As for --preload, I don't have any real objection but we should at least stop a bit to consider adding nonstandard options that don't have precedent in other implementations. Once we've added something it's not really appropriate to remove it later. So I'd like to do just --library-path for now if it will solve your problem and keep --preload as a future idea. > I hope you are more positive to the latter patch (which I consider > being of acceptable quality). Yes, at first glance it looked right but I want to review it a bit more. The comment about suid isn't needed; making the dynamic loader suid is about the only thing stupider than making a shell suid. :-) Rich