mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
N°1114 - config-itop.php access rights enforcement
This commit is contained in:
@@ -186,7 +186,7 @@ class DBRestore extends DBBackup
|
|||||||
$sConfigFile = APPROOT.'conf/'.$sEnvironment.'/config-itop.php';
|
$sConfigFile = APPROOT.'conf/'.$sEnvironment.'/config-itop.php';
|
||||||
@chmod($sConfigFile, 0770); // Allow overwriting the file
|
@chmod($sConfigFile, 0770); // Allow overwriting the file
|
||||||
rename($sDataDir.'/config-itop.php', $sConfigFile);
|
rename($sDataDir.'/config-itop.php', $sConfigFile);
|
||||||
@chmod($sConfigFile, 0444); // Read-only
|
@chmod($sConfigFile, 0440); // Read-only
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ try
|
|||||||
$oTempConfig = new Config($sTmpFile, true);
|
$oTempConfig = new Config($sTmpFile, true);
|
||||||
$oTempConfig->WriteToFile($sConfigFile);
|
$oTempConfig->WriteToFile($sConfigFile);
|
||||||
@unlink($sTmpFile);
|
@unlink($sTmpFile);
|
||||||
@chmod($sConfigFile, 0444); // Read-only
|
@chmod($sConfigFile, 0440); // Read-only
|
||||||
|
|
||||||
if (DBPasswordInNewConfigIsOk($sConfig))
|
if (DBPasswordInNewConfigIsOk($sConfig))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user