[TYPO3-core] RFC: protect localconf.php from being lost

Karsten Dambekalns karsten at typo3.org
Fri Dec 16 15:17:38 CET 2005


Hi.

On Friday 16 December 2005 11:08, Martin Kutschker wrote:
> Write the new config to a temp. file. Check if this has been written
> properly and replace the old file.

-1

Only recently the way localconf.php was backed up has been changed to avoid 
information disclosure. The temp file being written with this patch does not 
have a PHP file extension any longer. If anything goes wrong before the file 
has been renamed, this may lead to disclosure of confidential information (db 
account, ...).

Solution: change the temporary filename so it ends with .php

Additionally I would delete the temporary file if it has been written but did 
not match the check wit strcmp or could not be renamed. This avoids a 
cluttered filesystem.

As for the die() calls - what about just putting the error message into 
$this->messages[] and hope the admin will look carefully enough at the 
output? This way it could be called "graceful" error handling, somewhat at 
least.

Karsten
-- 
Karsten Dambekalns
TYPO3 Association - Active Member
http://association.typo3.org/



More information about the TYPO3-team-core mailing list