This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
RE: LD_LIBRARY_PATH/LD_RUN_PATH
- To: "'libstdc++ at gcc dot gnu dot org'" <libstdc++ at gcc dot gnu dot org>
- Subject: RE: LD_LIBRARY_PATH/LD_RUN_PATH
- From: "Dana, Eric" <Eric_Dana at bmc dot com>
- Date: Fri, 2 Nov 2001 11:07:50 -0600
Yes, -rpath is respected by setgid/setuid programs. We use it here in
our product.
Eric Dana
BMC Software Inc.
-----Original Message-----
From: Nathan Myers [mailto:ncm@nospam.cantrip.org]
Sent: Thursday, November 01, 2001 5:28 PM
To: libstdc++@gcc.gnu.org
Subject: Re: LD_LIBRARY_PATH/LD_RUN_PATH
On Thu, Nov 01, 2001 at 04:52:35PM -0500, Phil Edwards wrote:
> On Thu, Nov 01, 2001 at 03:02:23PM -0500, Balaraman S (Bala) wrote:
> > When I turnon setuid bit for an application then
> > LD_LIBRARY_PATH/LD_RUN_PATH are not used to search shared library.
>
> Of course not. It's a security feature that has nothing to do with the
> compiler or the C++ library. Read the man page for ld.so for more.
In particular, look up -rpath option on ld. To get it from g++,
you might have to say "-Wl,-rpath -Wl,/usr/local/foo". I think
"-Wl,-R/usr/local/foo" might have the same effect, as might setting
"LD_RUN_PATH=/usr/local/foo" in the *build* environment. But you'll
have to try them. (You might just be out of luck. I can't find any
docs to say whether ld.so ignores -rpath options on setgid programs.)
Nathan Myers
ncm at cantrip dot org