in reply to Re: changing uid/gid in suid cgi script
in thread changing uid/gid in suid cgi script
I had this problem with Compaq Tru64 UNIX, the fix I used was a small bit of C code (yes I know it isn't Perl :-) as follows:
Save this as 'wrapper.c' and compile it with#include <unistd.h> int main (int argc, char *argv[]) { execl("/path/to/yourscript.pl", "yourscript.pl", NULL); }
Set the permissions of 'wrapper' so it runs SUID root, then the EUID and EGID variables in your Perl script will be correctly set.cc -o wrapper wrapper.c
As Zaxo said, this is dangerous, but if you really want to...
(Code taken from the book 'Professional Apache' published by Wrox)
Regards,
JJ
|
|---|