summaryrefslogtreecommitdiffstats
path: root/lib/config.php
diff options
context:
space:
mode:
authorThomas Mueller <thomas.mueller@tmit.eu>2012-06-12 23:15:44 +0200
committerThomas Mueller <thomas.mueller@tmit.eu>2012-06-12 23:16:26 +0200
commit521294d0bf9803cb4ffdc6fb43bd9b9253fece40 (patch)
tree9d8842a20fc7af1df5bacf74ccce3170eb58335f /lib/config.php
parent790ae70e321713007863705d4a444edc2e53791e (diff)
downloadnextcloud-server-521294d0bf9803cb4ffdc6fb43bd9b9253fece40.tar.gz
nextcloud-server-521294d0bf9803cb4ffdc6fb43bd9b9253fece40.zip
fixes http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-987
Diffstat (limited to 'lib/config.php')
-rw-r--r--lib/config.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/config.php b/lib/config.php
index e3a9c11f247..9279549b1bb 100644
--- a/lib/config.php
+++ b/lib/config.php
@@ -170,14 +170,18 @@ class OC_Config{
}
$content .= ");\n?>\n";
+ $filename = OC::$SERVERROOT."/config/config.php";
// Write the file
- $result=@file_put_contents( OC::$SERVERROOT."/config/config.php", $content );
+ $result=@file_put_contents( $filename, $content );
if(!$result) {
$tmpl = new OC_Template( '', 'error', 'guest' );
$tmpl->assign('errors',array(1=>array('error'=>"Can't write into config directory 'config'",'hint'=>"You can usually fix this by giving the webserver user write access to the config directory in owncloud")));
$tmpl->printPage();
exit;
}
+ // Prevent others not to read the config
+ @chmod($filename, 0640);
+
return true;
}
}