Ok, I have a simple cgi program that I'd like to be able to "turn on and off" with a php script. Easy enough, just rename it and it'll be turned off! So, I use:
That should do nicely, right? Wrong! Sadly, permission is denied. Well, of course permission was denied; the directory is not writeable by others. The script works just fine if you chmod 777 the directory, but who in their right mind would leave a directory with cgi files like that?! Even if I were that crazy, the script won't run if it's writeable by others anyway. So, that's not even an imaginary option.Code:<?php rename("on.cgi", "off.cgi"); ?>
So, my question: Is there some way around this? Something I can put in the script to sort of "authorize it" to rename the file?


LinkBack URL
About LinkBacks



Reply With Quote
Bookmarks