summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2022-06-12 02:33:15 +0200
committerGitHub <noreply@github.com>2022-06-12 02:33:15 +0200
commitd2bd06508e40a9c61f6f1d457090fdb621db47e1 (patch)
tree4da17f7931487a34bfe5ca678388c8535b598c26 /lib/private
parentc66ad2cf917dd326824120ca69862c5b6ea70910 (diff)
parent4055174c18c7cc556bb1e376201ffaf59ff7b5aa (diff)
downloadnextcloud-server-d2bd06508e40a9c61f6f1d457090fdb621db47e1.tar.gz
nextcloud-server-d2bd06508e40a9c61f6f1d457090fdb621db47e1.zip
Merge pull request #32445 from nextcloud/backport/32357/stable23
[stable23] remove storage wrappers when deleting the user storage
Diffstat (limited to 'lib/private')
-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) {