summaryrefslogtreecommitdiffstats
path: root/lib/private/Authentication
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2022-05-12 14:40:20 +0200
committerRobin Appelman <robin@icewind.nl>2022-05-12 14:40:20 +0200
commit5d69343efa4530341c339ab212ca18827332aff8 (patch)
treea44d0b01a9bc7213f17c704e095c6f8abe26fb30 /lib/private/Authentication
parent33ffaad14bd15c8f6ed370b28bc83feec4f69980 (diff)
downloadnextcloud-server-5d69343efa4530341c339ab212ca18827332aff8.tar.gz
nextcloud-server-5d69343efa4530341c339ab212ca18827332aff8.zip
remove storage wrappers when deleting the user storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Authentication')
-rw-r--r--lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php b/lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php
index fa7459e10ff..2fb05159d09 100644
--- a/lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php
+++ b/lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php
@@ -26,6 +26,7 @@ declare(strict_types=1);
namespace OC\Authentication\Listeners;
use OC\Files\Cache\Cache;
+use OC\Files\Storage\Wrapper\Wrapper;
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;
use OCP\Files\Config\IMountProviderCollection;
@@ -56,6 +57,13 @@ class UserDeletedFilesCleanupListener implements IEventListener {
if (!$storage) {
throw new \Exception("User has no home storage");
}
+
+ // remove all wrappers, so we do the delete directly on the home storage bypassing any wrapper
+ while ($storage->instanceOfStorage(Wrapper::class)) {
+ /** @var Wrapper $storage */
+ $storage = $storage->getWrapperStorage();
+ }
+
$this->homeStorageCache[$event->getUser()->getUID()] = $storage;
}
if ($event instanceof UserDeletedEvent) {