in the posix library there is a seteuid() command... although
a) it probably won't work on win2k... unless they got posix compliance sometime when i wasn't looking
b) you usually have to be root before it will work. ha!
a MUCH better solution is to write a fast "wrapper" in C something like:
#includ <unistd.h>
#includ <stdio.h>
int main(void) // accept no args for safety!
{
if( seteuid( 0 ) == -1 ) {
return 0l
}
else
{
exec("my-fave-command with args");
}
}
then just make sure that this little program is owned by root (uh, administrator...) and, boom, it will be done.
now, if you want to get feedback from your command, you should replace exec with popen(), read all the data off the resulting pointer and then print it to stdout... then in your php script also use popen to harvest the output from your wrapper.