]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixes http://bugs.owncloud.org/thebuggenie/owncloud/issues/oc-987
authorThomas Mueller <thomas.mueller@tmit.eu>
Tue, 12 Jun 2012 21:15:44 +0000 (23:15 +0200)
committerThomas Mueller <thomas.mueller@tmit.eu>
Tue, 12 Jun 2012 21:16:26 +0000 (23:16 +0200)
lib/config.php

index e3a9c11f2477b5fb2ea54f5e47cbbb1cf9aab1e7..9279549b1bbdcbd6dba11bd5a2b24bba281dfd96 100644 (file)
@@ -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;
        }
 }