Tighten permissions on auto-generated config file

This commit is contained in:
Starbeamrainbowlabs 2019-01-15 16:42:12 +00:00
parent f66083575a
commit 2787ea7c4c
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
1 changed files with 4 additions and 1 deletions

View File

@ -10,10 +10,12 @@ use \Yosymfony\Toml\TomlBuilder;
* Handles the loading and saving of settings from a toml file. * Handles the loading and saving of settings from a toml file.
* Supports loading default settings from a separate file. * Supports loading default settings from a separate file.
* @author Starbeamrainbowlabs * @author Starbeamrainbowlabs
* @version v0.5.1 * @version v0.5.2
* @lastModified 22nd March 2017 * @lastModified 22nd March 2017
* @license https://www.mozilla.org/en-US/MPL/2.0/ Mozilla Public License 2.0 * @license https://www.mozilla.org/en-US/MPL/2.0/ Mozilla Public License 2.0
* Changelog: * Changelog:
* v0.5.2 - 15th January 2018
* chmod auto-generated settings file to be 0600
* v0.5.1 - 14th January 2018 * v0.5.1 - 14th January 2018
* Make auto-generated settings files valid * Make auto-generated settings files valid
* v0.5 - 9th September 2018 * v0.5 - 9th September 2018
@ -61,6 +63,7 @@ class TomlConfig
} else { } else {
mkdir(dirname($settingsFilePath), 0750, true); mkdir(dirname($settingsFilePath), 0750, true);
file_put_contents($settingsFilePath, "$this->customSettingsBanner\n"); file_put_contents($settingsFilePath, "$this->customSettingsBanner\n");
chmod($settingsFilePath, 0600);
} }
} }
/** /**