Skip to content

Commit 4055174

Browse files
icewind1991PVince81
authored andcommitted
remove storage wrappers when deleting the user storage
Signed-off-by: Robin Appelman <[email protected]>
1 parent 938c291 commit 4055174

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/private/Authentication/Listeners/UserDeletedFilesCleanupListener.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
namespace OC\Authentication\Listeners;
2727

2828
use OC\Files\Cache\Cache;
29+
use OC\Files\Storage\Wrapper\Wrapper;
2930
use OCP\EventDispatcher\Event;
3031
use OCP\EventDispatcher\IEventListener;
3132
use OCP\Files\Config\IMountProviderCollection;
@@ -56,6 +57,13 @@ public function handle(Event $event): void {
5657
if (!$storage) {
5758
throw new \Exception("User has no home storage");
5859
}
60+
61+
// remove all wrappers, so we do the delete directly on the home storage bypassing any wrapper
62+
while ($storage->instanceOfStorage(Wrapper::class)) {
63+
/** @var Wrapper $storage */
64+
$storage = $storage->getWrapperStorage();
65+
}
66+
5967
$this->homeStorageCache[$event->getUser()->getUID()] = $storage;
6068
}
6169
if ($event instanceof UserDeletedEvent) {

0 commit comments

Comments
 (0)