mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
N°4660 Fix iTopConfigParserTest setting permissions of iTop config file
Alternative method to restore config file chmod cannot be used with +w In \Config::WriteToFile we are using fopen with mode=w, so using the same In consequence we are not modifying anymore the iTop config file permissions \o/
This commit is contained in:
@@ -44,9 +44,10 @@ class iTopConfigParserTest extends ItopTestCase
|
|||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
if ($this->conf_exists) {
|
if ($this->conf_exists) {
|
||||||
// restoring config that was in place before the test
|
// restoring config that was in place before the test
|
||||||
@chmod($this->sConfigPath, 0770); // RWX for owner and group, nothing for others : else we will have permission denied !
|
$sBackupConfigFileContent = file_get_contents($this->tmpSavePath);
|
||||||
rename($this->tmpSavePath, $this->sConfigPath);
|
$hItopConfigFile = @fopen($this->sConfigPath, 'w');
|
||||||
@chmod($this->sConfigPath, 0444);
|
fwrite($hItopConfigFile, $sBackupConfigFileContent);
|
||||||
|
fclose($hItopConfigFile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user