in reply to Script run as a Cron Job

I sure hope you check the username, password and domain names very very carefully, lest someone uses this trick to cause havoc on your system.

But why are you doing it this way? Why don't you call myperlscript from your CGI program?

Abigail

Replies are listed 'Best First'.
Re: Re: Script run as a Cron Job
by bobrobclob (Initiate) on Aug 23, 2002 at 14:38 UTC
    would that work? wouldn't that mean that the myperlscript was being run by webd, which means that it would not have sufficinet rights to run the adduser command?
      Well, you can always make myperlscript suid, or use a setuid wrapper (in fact, you are now using cron to give you this wrapper).

      Otherwise, you could log the new usernames/passwords in a file or database and create a new program that is called from cron. The task of this program is to read the entries, call myperlscript and delete the entries from the file or database. If you use a file, make sure you properly flock it when modifying it.

      Abigail

        Uhm, if you have permission to run the adduser command, you really should know all of this.

        Look up the 'chmod' command.

        Abigail

        how would i go about suid'ing the script? i'm a bit new to all of this and most of what you just said went 'whooosh - straight over my head!'