Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How do I execute as root?

by chromatic (Archbishop)
on Nov 14, 2000 at 01:29 UTC ( #41438=note: print w/replies, xml ) Need Help??


in reply to How do I execute as root?

I would separate the directory creation from the CGI completely. There are a couple of approaches.
  • Create a script that runs every minute or five minutes from cron. Have it check a directory for files containing username. If found, create the appropriate directories. Have your CGI script save the user name to a file in this directory and exit.
  • Create a daemon process, and have it listen on a socket or pipe for incoming data. Have the CGI script connect to the daemon and send the user name.
  • Create a normal program and have it sleep. Write a pid somewhere, or grab it from the CGI script. Have the CGI script send a user-defined signal to the sleeper, which will then wake up, check for an entry in a database or a new file in a directory, and perform the updates.
In no case would I trust the CGI script with root access. The first option is my preference.

Replies are listed 'Best First'.
RE: Re: How do I execute as root?
by le (Friar) on Nov 14, 2000 at 03:13 UTC
    We use the socket approach here, and it works fine. I would go with it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://41438]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (1)
As of 2021-10-22 00:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (85 votes). Check out past polls.

    Notices?