Perl, Web front end, access rights - Help a newbie?

Fraser Campbell fraser-eicrhRFjby5dCsDujFhwbypxlwaOVQ5f at public.gmane.org
Tue Apr 27 14:19:06 UTC 2004


On Tuesday 27 April 2004 09:55, Madison Kelly wrote:

>    My question is: How can I get 'root' access to the server via a CGI
> script? I am pretty sure that it can be does because CUPS seems to do it
> (I have to enter the 'root' username and password before I can manage
> printers).

cups runs as root and has a built in webserver, apache generally does not run 
as root.  You could run apache as root but it's not recommended.

>    I have already written the first part where I use two lists, one for
> valid source partitions (which can only be read from) and one for valid
> destination partitions (which can be accessed read/write) and any other
> partition will be ignored. The script verifies that at least one valid
> source and one valid destinatiton exists before continuing. Now I want
> to start the webifying but I need your help (pretty please?)!

One approach is using sudo to call command line scripts with appropriate 
paramaters (and parameter checking).

You could also have a root cronjob (or even a continually running process) 
that keeps an eye out for new jobs ... the cgi script can store those jobs in 
a database, a file, it could communicate with your other process, etc.

-- 
Fraser Campbell <fraser-Txk5XLRqZ6CsTnJN9+BGXg at public.gmane.org>                 http://www.wehave.net/
Georgetown, Ontario, Canada                               Debian GNU/Linux
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list