Can a 'setuid root' application inherit LD_LIBRARY_PATH ?

Can a 'setuid root' application inherit LD_LIBRARY_PATH ?

Post by card.. » Sun, 22 Jan 1995 10:56:44



I've got an application that needs to run with setuid root.

However, it cannot run because it is looking for shared libraries
that are normally searched via LD_LIBRARY_PATH

I have already tried setting LD_LIBRARY_PATH inside of
/etc/default/su, but it is ignored.  And it does not seem to make any
difference whether root's shell is Bourne or C, since the /.* files are
not read during a setuid.

How can I get a setuid application to inherit LD_LIBRARY_PATH
under Solaris 2.3?

Thanks for any information,

 
 
 

Can a 'setuid root' application inherit LD_LIBRARY_PATH ?

Post by Casper H.S. D » Mon, 23 Jan 1995 18:05:22



>I've got an application that needs to run with setuid root.

>However, it cannot run because it is looking for shared libraries
>that are normally searched via LD_LIBRARY_PATH

>I have already tried setting LD_LIBRARY_PATH inside of
>/etc/default/su, but it is ignored.  And it does not seem to make any
>difference whether root's shell is Bourne or C, since the /.* files are
>not read during a setuid.

Set-uid has nothing to do with su.  Nor are any of root's files
read during startup of a set-uid program

Quote:>How can I get a setuid application to inherit LD_LIBRARY_PATH
>under Solaris 2.3?

You can't. All you can do is link the program with -R<librarypath>
and it will have a builtin LD_LIBRARY_PATH.

It should never be necessary to use LD_LIBRARY_PATH.

Casper

 
 
 

Can a 'setuid root' application inherit LD_LIBRARY_PATH ?

Post by Rob McMah » Wed, 25 Jan 1995 01:58:07



writes:

Quote:>You can't. All you can do is link the program with -R<librarypath> and it
>will have a builtin LD_LIBRARY_PATH.

Or if you're really stuck, put symlinks from the libraries to /usr/lib

Quote:>It should never be necessary to use LD_LIBRARY_PATH.

(except in shell wrappers for some third party apps)

Cheers,

Rob
--
UUCP:   ...!mcsun!uknet!warwick!cudcv   PHONE:  +44 203 523037

Rob McMahon, Computing Services, Warwick University, Coventry CV4 7AL, England

 
 
 

Can a 'setuid root' application inherit LD_LIBRARY_PATH ?

Post by Fletcher.Gl.. » Wed, 25 Jan 1995 02:01:21



Quote:>I've got an application that needs to run with setuid root.

>However, it cannot run because it is looking for shared libraries
>that are normally searched via LD_LIBRARY_PATH

>I have already tried setting LD_LIBRARY_PATH inside of
>/etc/default/su, but it is ignored.  And it does not seem to make any
>difference whether root's shell is Bourne or C, since the /.* files are
>not read during a setuid.

>How can I get a setuid application to inherit LD_LIBRARY_PATH
>under Solaris 2.3?

Compile your application with the -R option to include the library
path in the executable.  Try man ld(1) for more info on the
-R option.

 
 
 

1. su cellopt -c "sh -c 'LD_LIBRARY_PATH=/usr/lib; echo $LD_LIBRARY_PATH'"

I'm writing a script that is to be executed with another user, using su
<user> -c  in the script.
But since the user might not have the correct LD_LIBRARY_PATH I will need to
set that first
my thought was something like the line below, but for some reason it does
not work, although
if I type it in line the second line (167) i.e. without the su command it
works just fine.
What is it that I am doing wrong here?


$LD_LIBRARY_PATH'"
/usr/lib:/usr/local/lib:/usr/lib/X11:/usr/openwin/lib

/usr/lib

Regards
 Tobias

2. ISDN?& V.35 hardware

3. Why is 'star' setuid root?

4. How to prevent Users from logging in on a TIMED basis ?

5. pppd in 'setuid-root' mode

6. Makefile params - urgent

7. How to effectively simulate 'root' - using setuid()

8. Can SAMBA do this?

9. 'su' and 'LD_LIBRARY_PATH'

10. pd-ksh/zsh won't inherit '747=jet' env var?

11. LD_LIBRARY_PATH and setuid (was: strange: LD_LIBRARY_PATH disappears)

12. Inherited machine...don't know root password...need to rebuild

13. LD_LIBRARY_PATH and setuid-root programs