Hello MadeInGermany,
As suggested by you i used env and here is an interesting observation
Inside testremove.ksh I added the following lines
#!/usr/bin/ksh
export LD_LIBRARY_PATH=/app/asset_control_shared/DEV1_acdev1_usl20028171/ac/lib
echo "LD_LIBRARY_PATH using echo====$LD_LIBRARY_PATH"echo "Printing LD_LIBRARY_PATH value using env begins"
env|egrep '(HISTSIZE|LD_LIBRARY_PATH)'echo "Printing LD_LIBRARY_PATH value using env end"
/app/asset_control_shared/DEV1_acdev1_usl20028171/ac/bin/waitdb.ORACLE
First I remove setuid on invoke_shellscripts binary as below (owner acdev1)
-rwxr-x--x 1 acdev1 rdgac 8612 Jan 3 11:53 invoke_shellscripts
-rwxr-x--- 1 acdev1 rdgac 526 Jan 3 18:11 testremove.ksh
Then as another user acdev2 I ran from commandline
./invoke_shellscripts ./testremove.ksh
I got the following output:
LD_LIBRARY_PATH using echo====/app/asset_control_shared/DEV1_acdev1_usl20028171/ac/lib
Printing LD_LIBRARY_PATH value using env begins
HISTSIZE=1000
LD_LIBRARY_PATH=/app/asset_control_shared/DEV1_acdev1_usl20028171/ac/lib
Printing LD_LIBRARY_PATH value using env end
Now I added setuid bit to invoke_shellscripts binary as follows
-rwsr-x--x 1 acdev1 rdgac 8612 Jan 3 11:53 invoke_shellscripts
-rwxr-x--- 1 acdev1 rdgac 526 Jan 3 18:11 testremove.ksh
Now I reran this from command line
./invoke_shellscripts ./testremove.ksh
And this time I got following output suggesting that when setuid bit is set, LD_LIBRARY_PATH is ignored. As you can see echo correctly prints the value of LD_LIBRARY_PATH set in the 1st line of the script however env doesnot have it. It shows only HISTSIZE from the env|egrep command.
LD_LIBRARY_PATH using echo====/app/asset_control_shared/DEV1_acdev1_usl20028171/ac/lib
Printing LD_LIBRARY_PATH value using env begins
HISTSIZE=1000
Printing LD_LIBRARY_PATH value using env end
testremove.ksh is the one that will be calling the 3rd party binary that uses the library libuidata.so located in /app/asset_control_shared/DEV1_acdev1_usl20028171/ac/lib. How do you think this problem can be fixed using setuid( geteuid()) ?
thanks