LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-24-2008, 01:59 PM   #1
RGummi
Member
 
Registered: Nov 2005
Posts: 90

Rep: Reputation: 15
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
 
Old 03-25-2008, 07:46 AM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
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.
 
Old 03-25-2008, 01:16 PM   #3
RGummi
Member
 
Registered: Nov 2005
Posts: 90

Original Poster
Rep: Reputation: 15
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
 
Old 03-25-2008, 01:45 PM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
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.
 
Old 03-25-2008, 05:24 PM   #5
RGummi
Member
 
Registered: Nov 2005
Posts: 90

Original Poster
Rep: Reputation: 15
Hello,

thanks! I will stay using sudo.

RGummi
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash child process in foreground while parent dies kborgnis Programming 3 11-09-2007 06:50 AM
Running commands from array in a child bash script bengoavs Programming 2 10-26-2007 02:16 PM
Setting up cron to proccess a Bash Script to run every 15 minutes jamtech Programming 3 07-30-2007 03:32 PM
Bash script to email setuid root files deoren LinuxQuestions.org Member Success Stories 1 01-30-2005 09:56 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration