Why do you want to do this via a CGI interface?
You could write a wrapper in C which execs your script and setuid the wrapper. Better might be to have the script call a setuid program that does the minimal amount necessary with root privs. Whatever you do, be extremely careful with user input. Run with tainting enabled (-T) and untaint the data very carefully.
Better yet, just don't do this.
-sauoq "My two cents aren't worth a dime.";
In reply to Re: running root command from cgi
by sauoq
in thread running root command from cgi
by XYZ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |