LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   bash setuid child proccess (https://www.linuxquestions.org/questions/linux-general-1/bash-setuid-child-proccess-630292/)

RGummi 03-24-2008 01:59 PM

bash setuid child proccess
 
Hello,

in a script I adjust some firewall settings (via iptables calls). I want that users can run the script so I have tried to set the SID bit but the iptables calls throw an error saying permission denied. So my question: Is there a possibility that the iptables calls inherit the setuid?

PS: I know that I could use sudo for such a task ;-)

RGummi

trickykid 03-25-2008 07:46 AM

Well, iptables itself needs root access. Setting your script that calls iptables with setuid isn't going to cut it. I'd say go with the sudo option.

RGummi 03-25-2008 01:16 PM

Hello,

thanks, this is what I have done now (sudo). But I was astonished that setuid does not work, is this specific for iptables or a general rule?

Thanks
RGummi

matthewg42 03-25-2008 01:45 PM

I think it is not allowed to use suid/sgid with scripts (only binaries).

See this.

That is to say, you can set it, but your script will not get suid privileges.

RGummi 03-25-2008 05:24 PM

Hello,

thanks! I will stay using sudo.

RGummi


All times are GMT -5. The time now is 11:10 PM.