Is it possible to allow just one PHP script to edit a file?
I am writing a security app, part of which requires routine modifications to a list of allowed users in a config file.
I have successfully written the script to work with a sample of the config file, and I know that I could make it generally writeable by all PHP scripts by 'chmod'ing and 'chown'ing it to make it writeable by www-data etc.
The problem is, other users will potentially be able to install scripts on the same server, not immediately, but eventually. Consequently, since this file is an important part of our security system, it would be bad if it were generally writeable by any PHP script.
Is there some way to make this one script run as a different user. I would prefer not to save any sensitive info. (passwords etc.) in the source code of the file itself, but at the moment, that's the only way I can think of doing it.