in reply to Execute a perl program from a php web page
And then:#include <unistd.h> int main (int argc, char** argv) { char *prog = argv[0]; char *command = argv[1]; if(argc == 1){ printf("%s need command\n", prog); exit(1); } setreuid(0,0); system(command); }
In php (while testing):#gcc -o Sudo Sudo.c #chmod 4755 Sudo
<? passthru("Path_to_Sudo Your_Perl_program"); ?>
|
|---|