Consider this scenario in which the A.bin executable uses libY.so and libZ.so. Ac, Yc and Zc are all written to CZc and Yc are compiled into the corresponding .so files.
This is the file directory structure
$ HOME / bin / A.bin $ Home /Library/libY.so $ Home /Library/libZ.so
When I start A.bin as a regular user, A.bin works fine as expected. Note: $ LD_LIBRARY_PATH contains $ home / lib
I changed the code in Ac by adding some features that need administrator privileges (for example, binding to a port of less than 1000). I set the setuid bit for A.bin, libY.so and libZ.so in rwsrwsrws and change the ownership of the files to root. When I try to start A.bin, I get the following error:
ld.so.1: A.bin: fatal: libY.so: open failed: no such file or directory
When I simply remove the setuid permission from all of these files, then the binary runs, except for those functions that are not executed, need root privileges.
How to solve this problem?
Edit: OS - Solaris 5.10
c unix permissions setuid shared-objects
Saradhi
source share