summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php6
-rw-r--r--lib/private/helper.php8
2 files changed, 11 insertions, 3 deletions
diff --git a/lib/base.php b/lib/base.php
index cd5d8feb1f6..74b668551ab 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -188,9 +188,9 @@ class OC {
public static function checkConfig() {
$l = \OC::$server->getL10N('lib');
- if (file_exists(self::$configDir . "/config.php")
- and !is_writable(self::$configDir . "/config.php")
- ) {
+ $configFileWritable = file_exists(self::$configDir . "/config.php") && is_writable(self::$configDir . "/config.php");
+ if (!$configFileWritable && !OC_Helper::isReadOnlyConfigEnabled()
+ || !$configFileWritable && \OCP\Util::needUpgrade()) {
if (self::$CLI) {
echo $l->t('Cannot write into "config" directory!')."\n";
echo $l->t('This can usually be fixed by giving the webserver write access to the config directory')."\n";
diff --git a/lib/private/helper.php b/lib/private/helper.php
index d43eefcdc52..0e302275540 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -973,4 +973,12 @@ class OC_Helper {
return array('free' => $free, 'used' => $used, 'total' => $total, 'relative' => $relative);
}
+
+ /**
+ * Returns whether the config file is set manually to read-only
+ * @return bool
+ */
+ public static function isReadOnlyConfigEnabled() {
+ return \OC::$server->getConfig()->getSystemValue('config_is_read_only', false);
+ }
}