October 22nd, 2000, 11:34 PM
Is there a way to write a Perl script that would run as a different user?? To be more specific, I want to write a Perl CGI program that would change user as soon as it is executed. Of course, the user executing the program would be the user Apache runs under (nobody or www).
So, again, is there a way to do this, or will I have to write a small C program to do this?? (Please tell me no... )
October 23rd, 2000, 12:43 AM
This is actually an Apache question. It doesn't matter whether it's Perl or PHP or any others, you just can't change the user Apache runs as within your script.
That's why you need SuEXEC or Cgiwrap to accomplish your task.
Another way is to recompile Apache and add -DBIG_SECURITY_HOLE to the EXTRA_CFLAGS line or your src/Configuration file. That is, your Apache is capable to run as root. Be warned, you need to know what you are doing when running Apache as root.
October 23rd, 2000, 03:11 PM
So there is only that way?? OK, then, SuEXEC is the way, since running Apache as root is not something to be toyed with.
Another question, as a follow-up: any good tutorials or documents on SuEXEC and how to use it??
October 24th, 2000, 02:07 AM
October 24th, 2000, 03:10 AM
Thanks a lot. Will read these docs and see what I came uo with...