From 847bd7d0cf8f4d1405f687e030c15f9e3e60525a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Fri, 2 Feb 2024 12:59:47 +0100 Subject: [PATCH] fix: Run file renaming in lock scope of the user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Controller/WopiController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Controller/WopiController.php b/lib/Controller/WopiController.php index a3546b1ca9..f4a84bf2cb 100644 --- a/lib/Controller/WopiController.php +++ b/lib/Controller/WopiController.php @@ -652,7 +652,13 @@ public function postFile(string $fileId, string $access_token): JSONResponse { // create a unique new file $path = $this->rootFolder->getNonExistingName($path); - $file = $file->move($path); + $this->lockManager->runInScope(new LockContext( + $this->getFileForWopiToken($wopi), + ILock::TYPE_APP, + Application::APPNAME + ), function () use (&$file, $path) { + $file = $file->move($path); + }); } else { $file = $this->getFileForWopiToken($wopi);