diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2024-02-24 19:31:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-24 19:31:22 +0100 |
commit | b080113fdd81ab28305b0da3e02691e05237f77f (patch) | |
tree | a347e274ff86e40da457c6b580d0e0e5cf97dbe9 /lib/private/Files | |
parent | c98b0462e33011a99aeaba582d82e52fdb14c3ae (diff) | |
parent | 1d09dec66c0d0962b42587ab3ddadbcb67dcad65 (diff) | |
download | nextcloud-server-b080113fdd81ab28305b0da3e02691e05237f77f.tar.gz nextcloud-server-b080113fdd81ab28305b0da3e02691e05237f77f.zip |
Merge branch 'master' into fix/42480/user-admin-not-admin
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
Diffstat (limited to 'lib/private/Files')
-rw-r--r-- | lib/private/Files/SetupManager.php | 6 | ||||
-rw-r--r-- | lib/private/Files/Storage/Common.php | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/private/Files/SetupManager.php b/lib/private/Files/SetupManager.php index 511e80bd7d9..93b7dc37b6b 100644 --- a/lib/private/Files/SetupManager.php +++ b/lib/private/Files/SetupManager.php @@ -80,6 +80,7 @@ class SetupManager { private bool $listeningForProviders; private array $fullSetupRequired = []; private bool $setupBuiltinWrappersDone = false; + private bool $forceFullSetup = false; public function __construct( private IEventLogger $eventLogger, @@ -97,6 +98,7 @@ class SetupManager { ) { $this->cache = $cacheFactory->createDistributed('setupmanager::'); $this->listeningForProviders = false; + $this->forceFullSetup = $this->config->getSystemValueBool('debug.force-full-fs-setup'); $this->setupListeners(); } @@ -470,6 +472,10 @@ class SetupManager { } private function fullSetupRequired(IUser $user): bool { + if ($this->forceFullSetup) { + return true; + } + // we perform a "cached" setup only after having done the full setup recently // this is also used to trigger a full setup after handling events that are likely // to change the available mounts diff --git a/lib/private/Files/Storage/Common.php b/lib/private/Files/Storage/Common.php index 65c2580e61c..830f0aaded7 100644 --- a/lib/private/Files/Storage/Common.php +++ b/lib/private/Files/Storage/Common.php @@ -62,6 +62,7 @@ use OCP\Files\ReservedWordException; use OCP\Files\Storage\ILockingStorage; use OCP\Files\Storage\IStorage; use OCP\Files\Storage\IWriteStreamStorage; +use OCP\Files\StorageNotAvailableException; use OCP\Lock\ILockingProvider; use OCP\Lock\LockedException; use OCP\Server; @@ -898,6 +899,11 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage { public function getDirectoryContent($directory): \Traversable { $dh = $this->opendir($directory); + + if ($dh === false) { + throw new StorageNotAvailableException('Directory listing failed'); + } + if (is_resource($dh)) { $basePath = rtrim($directory, '/'); while (($file = readdir($dh)) !== false) { |