suid & sgid
Hi
Hi I have problem with understanding setgid on a binary executable. I know that when sgid bit is set on a binary executable file it will run with the group permission of the binary file, instead of the one who runs it. There are lot of examples available on the internet demonstrating suid permissions, but not sgid permissions. I was able to demonstrate suid permissions by calling a bash script from a compiled c program with suid bit set. I have a file /tmp/1.txt which have the following permissions. Code:
ls -l /tmp/1.txt Code:
cat /tmp/read Code:
chmod u+x /tmp/read Code:
cat /tmp/call.c Code:
cd /tmp But I am unable to do the same with sgid bit set. Can any one provide me, an example like the above script to demonstrate sgid permissions ??? Please help ... |
Hello,
I'm not sure I understand you correctly but you can set the sgid with Code:
chmod g+s <yourfile> Kind regards, Eric |
I think the OPs issue is with the fact that the shell
script to cat the special text file isn't group executable to begin with. Making the C snippet setgid won't affect the script, there's still a permission problem. Cheers, Tink |
Hi Tink,
Missed that one, thanks for pointing it out. Kind regards, Eric |
All times are GMT -5. The time now is 07:15 AM. |