MDL-40642 set more restrictive umask and use proper permission for new dirs and files

This commit is contained in:
Petr Škoda
2013-07-19 09:18:44 +02:00
parent ffc3f5308b
commit eb459f7192
25 changed files with 52 additions and 15 deletions
+3 -1
View File
@@ -87,13 +87,15 @@ class sqlite3_pdo_moodle_database extends pdo_moodle_database {
* @return bool success
*/
public function create_database($dbhost, $dbuser, $dbpass, $dbname, array $dboptions=null) {
global $CFG;
$this->dbhost = $dbhost;
$this->dbuser = $dbuser;
$this->dbpass = $dbpass;
$this->dbname = $dbname;
$filepath = $this->get_dbfilepath();
$dirpath = dirname($filepath);
@mkdir($dirpath);
@mkdir($dirpath, $CFG->directorypermissions, true);
return touch($filepath);
}