diff options
-rw-r--r-- | lib/private/Installer.php | 10 | ||||
-rw-r--r-- | lib/private/legacy/OC_Util.php | 14 |
2 files changed, 10 insertions, 14 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php index 6b736bc104a..91d20a129ae 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -171,10 +171,20 @@ class Installer { /** * Get the path where to install apps + * + * @throws \RuntimeException if an app folder is marked as writable but is missing permissions */ public function getInstallPath(): ?string { foreach (\OC::$APPSROOTS as $dir) { if (isset($dir['writable']) && $dir['writable'] === true) { + // Check if there is a writable install folder. + if (!is_writable($dir['path']) + || !is_readable($dir['path']) + ) { + throw new \RuntimeException( + 'Cannot write into "apps" directory. This can usually be fixed by giving the web server write access to the apps directory or disabling the App Store in the config file.' + ); + } return $dir['path']; } } diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index da89365478c..ebca1105838 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -343,20 +343,6 @@ class OC_Util { } } - // Check if there is a writable install folder. - if ($config->getValue('appstoreenabled', true)) { - $installPath = \OCP\Server::get(\OC\Installer::class)->getInstallPath(); - if ($installPath === null - || !is_writable($installPath) - || !is_readable($installPath) - ) { - $errors[] = [ - 'error' => $l->t('Cannot write into "apps" directory.'), - 'hint' => $l->t('This can usually be fixed by giving the web server write access to the apps directory' - . ' or disabling the App Store in the config file.') - ]; - } - } // Create root dir. if ($config->getValue('installed', false)) { if (!is_dir($CONFIG_DATADIRECTORY)) { |