LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-09-2004, 05:04 AM   #1
prinski
LQ Newbie
 
Registered: Jul 2002
Posts: 7

Rep: Reputation: 0
running cgi as root


hi,

in my cgi script i need to run the ipsec command which only user root can run. I also need to write to files. At the moment I get permission denied for this.

so i definitely got to run my script as root, i think. What's the simplest solution?


my cgi file has: -rwsr-xr-x
the file i want to write to has: -rw-------


greets,

prinski
 
Old 04-19-2004, 03:10 AM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Don't run cgi script as root.

Are you sure you have to? How about creating a suid root helper program that does the needed ipsec calls and the cgi script calls this.
 
Old 01-07-2007, 11:43 AM   #3
alfabetykal
LQ Newbie
 
Registered: Jan 2007
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by ToniT
Don't run cgi script as root.

Are you sure you have to? How about creating a suid root helper program that does the needed ipsec calls and the cgi script calls this.

how exactly would you go about doing that? I made a personalized supporting library for IPTables::IPv4 and IPTables::IPv6 perl modules however since the modify iptables rules to the kernel level I can't seem to think of a way other than SUID to actually run the scripts. any ideas?
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
php running as CGI twk Programming 1 05-25-2004 08:26 AM
running cgi scripts in other directories init-5 Linux - Software 2 09-16-2003 03:01 PM
Running Perl/CGI scripts hso_sof Linux - Newbie 3 08-22-2003 10:26 AM
cgi running on apache foop37 Linux - Newbie 1 08-06-2003 09:34 AM
Need help for running perl/cgi... raymond Linux - General 2 11-20-2002 08:20 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:47 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