EVZEW@byzimr:/prog/home/EVZEW>ldd /usr/local/bin/sudoStrange. On my OpenSolaris box ldd runs fine for a normal user. Can you try ldd as a normal user on a different binary and a different setuid program? Maybe /usr/bin/who and /usr/bin/passwd. I haven't used regular Solaris in awhile and some of the permissions on OpenSolaris are different.
ldd: /usr/local/bin/sudo: cannot open file: Permission denied
I see I haven't access to a component that is needed, but what?
In other words your need to specify LDFLAGS like -R/usr/local/lib for compilation.
$ cc -o squash -L/usr/local/lib -R/usr/local/lib -lz squash.c
and did a new build from scratch:
# Flags to pass to the link stage LDFLAGS = -R/usr/local/lib
Many thanks for all the tips and support,
root@byzimr # ldd /usr/local/bin/sudo libpam.so.1 => /usr/lib/libpam.so.1 libdl.so.1 => /usr/lib/libdl.so.1 libintl.so.8 => /usr/local/lib/libintl.so.8 libsocket.so.1 => /usr/lib/libsocket.so.1 libnsl.so.1 => /usr/lib/libnsl.so.1 libc.so.1 => /usr/lib/libc.so.1 libcmd.so.1 => /usr/lib/libcmd.so.1 libiconv.so.2 => /usr/local/lib/libiconv.so.2 libsec.so.1 => /usr/lib/libsec.so.1 libgcc_s.so.1 => /usr/local/lib/libgcc_s.so.1 libmp.so.2 => /usr/lib/libmp.so.2 /usr/platform/SUNW,Sun-Fire/lib/libc_psr.so.1
jueadams wrote:My version of that is on MY web page at:
I've fixed the issue loading private librarys. I've done an internet search and found an interesting
article "When should I set LD_LIBRARY_PATH?" ( [find here|http://linuxmafia.com/faq/Admin/ld-lib-path.html] ).
The answer in that document was clear and simple: NEVER.
They advice is to specify library pathes for all libraries (static and dynamically loaded) at build time:
Many thanks for all the tips and support,Your welcome,
Good to know :)
Note that the dynamic linker on most operating systems will remove variables that can control dynamic linking from the environment of setuid executables, including sudo. Depending on the operating system this may include _RLD, DYLD_, LD_, LDR_, LIBPATH, SHLIB_PATH, and others. These type of variables are removed from the environment before sudo even begins execution and, as such, it is not possible for sudo to preserve them.