This isn't really a Perl question, because How to Do It depends on what your HTTP server software is. If it's apache, look into suEXEC.
Other than that, there aren't too many pitfalls (unless the user is root =) Running under -T is probably the biggest single thing you can do, as it will help you track down where your code isn't secure enough. You might create a user whose sole permission is to exec the htpasswd binaries, if you're truly paranoid.
A different kind of setup you might look into if you don't need *instant* updates is to have the CGI write to a file, and have a smart cron job running with more privileges handle the actual updating. But again, such pitfalls as exist will depend on your OS and HTTP server.
Philosophy can be made out of anything. Or less -- Jerry A. Fodor
In reply to Re: Running a CGI Script as user
by arturo
in thread Running a CGI Script as user
by skazat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |