From 27c33ae95b7fd58799f37cd6dc99b0936e650a21 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 e63fec9aa4..4028bd3580 100644 --- a/lib/Controller/WopiController.php +++ b/lib/Controller/WopiController.php @@ -656,7 +656,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);