diff options
author | Robin Appelman <robin@icewind.nl> | 2024-03-11 17:07:49 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2024-07-11 17:39:20 +0200 |
commit | 22596234fcd65134487d844ac38e2e7860debbc3 (patch) | |
tree | de0ed68521ea49c26debe9e1327a0262bd17cb2d /apps/files_sharing/lib | |
parent | 290ccdb68466f0c523dde1390c83d6896bc6329a (diff) | |
download | nextcloud-server-22596234fcd65134487d844ac38e2e7860debbc3.tar.gz nextcloud-server-22596234fcd65134487d844ac38e2e7860debbc3.zip |
fix: don't return null for SharedStorage::getWrapperStorage with share recursion
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/SharedStorage.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php index f41891c67f3..44ec877c52c 100644 --- a/apps/files_sharing/lib/SharedStorage.php +++ b/apps/files_sharing/lib/SharedStorage.php @@ -136,6 +136,16 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto private function init() { if ($this->initialized) { + if (!$this->storage) { + // marked as initialized but no storage set + // this is probably because some code path has caused recursion during the share setup + // we setup a "failed storage" so `getWrapperStorage` doesn't return null. + // If the share setup completes after this the "failed storage" will be overwritten by the correct one + $this->logger->warning('Possible share setup recursion detected'); + $this->storage = new FailedStorage(['exception' => new \Exception('Possible share setup recursion detected')]); + $this->cache = new FailedCache(); + $this->rootPath = ''; + } return; } |