> I've been working my way through the "Linker and Libraries Guide", but
> I'm not finding the answer I need. A pointer, slap upside the head,
> etc would be welcome.
> Is there some reason why a program running suid root would not use the
> LD_LIBRARY_PATH to find a library?
> In the specific case I'm working on, a suid root program runs a
> shell script (not owned by root), which runs a second program (also
> not owned by root).
> The shell script has some debug output in it that says the result of
> id is:
> uid=100(nortel) gid=100(nortel) euid=0(root)
> So, the shell script is running with an effective user id of root,
> which is what I would have expected. It then runs a binary (not suid)
> owned by nortel. This binary cannot find a shared library it depends
> on. Before running the binary, the shell script runs ldd on it, and
> produces the output
> ldd ../bin/commissioningCfg =
> librwtool.so.2 => (file not found)
> libsocket.so.1 => /usr/lib/libsocket.so.1
> libnsl.so.1 => /usr/lib/libnsl.so.1
> libC.so.5 => /usr/lib/libC.so.5
> libm.so.1 => /usr/lib/libm.so.1
> libw.so.1 => /usr/lib/libw.so.1
> libc.so.1 => /usr/lib/libc.so.1
> libdl.so.1 => /usr/lib/libdl.so.1
> libmp.so.2 => /usr/lib/libmp.so.2
> However, librwtool.so.2 is, in fact, in a directory specified by the
> If the shell script is run from the command line as nortel, with
> LD_LIBRARY_PATH set appropriately, it works fine.
> All the above holds true if the -R linker option is used to specify a
> runpath when linking, rather than using LD_LIBRARY_PATH.
> I'd appreciate a pointer in the right direction.