Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ public static function checkConfig(): void {

// Check if config is writable
$configFileWritable = is_writable($configFilePath);
if (!$configFileWritable && !OC_Helper::isReadOnlyConfigEnabled()
$configReadOnly = Server::get(IConfig::class)->getSystemValueBool('config_is_read_only');
if (!$configFileWritable && !$configReadOnly
|| !$configFileWritable && \OCP\Util::needUpgrade()) {
$urlGenerator = Server::get(IURLGenerator::class);
$l = Server::get(\OCP\L10N\IFactory::class)->get('lib');
Expand Down
3 changes: 2 additions & 1 deletion lib/private/legacy/OC_Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public static function is_function_enabled(string $function_name): bool {

/**
* Try to find a program
* @deprecated 25.0.0 Use \OC\BinaryFinder directly
* @deprecated 25.0.0 Use \OCP\IBinaryFinder directly
*/
public static function findBinaryPath(string $program): ?string {
$result = Server::get(IBinaryFinder::class)->findBinaryPath($program);
Expand Down Expand Up @@ -415,6 +415,7 @@ public static function clearStorageInfo(string $absolutePath): void {
/**
* Returns whether the config file is set manually to read-only
* @return bool
* @deprecated 32.0.0 use the `config_is_read_only` system config directly
*/
public static function isReadOnlyConfigEnabled() {
return \OC::$server->getConfig()->getSystemValueBool('config_is_read_only', false);
Expand Down
3 changes: 2 additions & 1 deletion lib/private/legacy/OC_Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public static function isDefaultExpireDateEnforced() {
*
* @param IUser|null $user
* @return int|\OCP\Files\FileInfo::SPACE_UNLIMITED|false|float Quota bytes
* @deprecated 9.0.0 - Use \OCP\IUser::getQuota
*/
public static function getUserQuota(?IUser $user) {
if (is_null($user)) {
Expand Down Expand Up @@ -331,7 +332,7 @@ public static function checkServer(\OC\SystemConfig $config) {
}

// Check if config folder is writable.
if (!OC_Helper::isReadOnlyConfigEnabled()) {
if (!(bool)$config->getValue('config_is_read_only', false)) {
if (!is_writable(OC::$configDir) or !is_readable(OC::$configDir)) {
$errors[] = [
'error' => $l->t('Cannot write into "config" directory.'),
Expand Down
Loading