I set up a MediaWiki on SourceForge. It seems that anyone with an account on SourceForge has read access to my LocalSettings.php file, which contains my database password.
From what I have read on the web, it seems that some people have successfully
been able to change the permissions of LocalSettings.php to 600. However, when I try this I get the following warning and error when I try to visit my site.
Warning: main(./LocalSettings.php): failed to open stream: Permission denied in /home/ groups/t/ta/takocompiler/htdocs/wikitako/index.php on line 19
Fatal error: main(): Failed opening required './LocalSettings.php' (include_path='.:/usr/ local/share/pear') in /home/groups/t/ta/takocompiler/htdocs/wikitako/index.php on line 19
I am using MediaWiki 1.3.9. Any suggestions on how to prevent people from reading my database password?
Thanks, Greg Kulczycki
On Dec 20, 2004, at 1:49 PM, gregwk wrote:
I set up a MediaWiki on SourceForge. It seems that anyone with an account on SourceForge has read access to my LocalSettings.php file, which contains my database password.
[snip]
I am using MediaWiki 1.3.9. Any suggestions on how to prevent people from reading my database password?
From what I can tell, you can't reliably do this on SourceForge.
The file must be readable by the web server; because of the way file permissions work this generally means it's readable by any local user: I can log into the SF servers as my own account and read your files, or I can write a web script on my SF site to read your SF site's files.
If the file is owned by you (instead of by the web server) then you can at least keep other people from changing its permissions, but you can't stop them reading it.
If SF used PHP's "Safe Mode" (which is problematic for many reasons, but sometimes useful for multiuser systems) this might be able to stop other peoples' PHP scripts from reading your file, but would probably not stop them from logging in and looking at your file or writing CGI scripts and looking at your file.
Any database-driven application running on SF will have a similar problem, as far as I can see. In order to connect to the database, the scripts _must_ have access to the plaintext password to open a connection. Since the scripts are run under a common user ID, they all have access.
-- brion vibber (brion @ pobox.com)
mediawiki-l@lists.wikimedia.org