From 06f0765e19b82029266e1515bf1e179f063f7833 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Wed, 15 Apr 2026 17:21:46 +0200 Subject: [PATCH 1/3] fix: Fix permission issue when uploading a chunked file Follow up from #59511 Signed-off-by: Carl Schwan --- apps/dav/appinfo/v2/publicremote.php | 8 ++++++-- lib/private/Files/Storage/Wrapper/DirPermissionsMask.php | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/dav/appinfo/v2/publicremote.php b/apps/dav/appinfo/v2/publicremote.php index d1286a577c741..03b8fb21f8519 100644 --- a/apps/dav/appinfo/v2/publicremote.php +++ b/apps/dav/appinfo/v2/publicremote.php @@ -6,7 +6,7 @@ * SPDX-License-Identifier: AGPL-3.0-only */ use OC\Files\Filesystem; -use OC\Files\Storage\Wrapper\PermissionsMask; +use OC\Files\Storage\Wrapper\DirPermissionsMask; use OC\Files\View; use OCA\DAV\Connector\Sabre\PublicAuth; use OCA\DAV\Connector\Sabre\ServerFactory; @@ -116,7 +116,11 @@ $mask |= Constants::PERMISSION_READ | Constants::PERMISSION_DELETE; } - return new PermissionsMask(['storage' => $storage, 'mask' => $mask]); + return new DirPermissionsMask([ + 'storage' => $storage, + 'mask' => $mask, + 'path' => 'files', + ]); }); /** @psalm-suppress MissingClosureParamType */ diff --git a/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php b/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php index 0ad4fc127b8e5..ca1667decf883 100644 --- a/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php +++ b/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php @@ -94,7 +94,7 @@ public function getPermissions($path): int { #[\Override] public function rename($source, $target): bool { - if (!$this->isUpdatable($source)) { + if (!$this->isDeletable($source)) { return false; } From 8850c29505fe056672cb6a9b4ded889c38bb1e59 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 21 Apr 2026 01:05:59 +0200 Subject: [PATCH 2/3] fix: Check if it is deletable and updatable Signed-off-by: Carl Schwan --- lib/private/Files/Storage/Wrapper/DirPermissionsMask.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php b/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php index ca1667decf883..abc955631ae7b 100644 --- a/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php +++ b/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php @@ -94,7 +94,7 @@ public function getPermissions($path): int { #[\Override] public function rename($source, $target): bool { - if (!$this->isDeletable($source)) { + if (!($this->isDeletable($source) || $this->isUpdatable($source))) { return false; } From 23447f1ec18ccd7ce2fa3b970dfe228dd887e34a Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 5 May 2026 14:45:26 +0200 Subject: [PATCH 3/3] fix: Uploading files not chuncked Co-authored-by: David Dreschner Signed-off-by: Carl Schwan Signed-off-by: Carl Schwan --- .../Files/Storage/Wrapper/DirPermissionsMask.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php b/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php index abc955631ae7b..7989002496e78 100644 --- a/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php +++ b/lib/private/Files/Storage/Wrapper/DirPermissionsMask.php @@ -94,7 +94,15 @@ public function getPermissions($path): int { #[\Override] public function rename($source, $target): bool { - if (!($this->isDeletable($source) || $this->isUpdatable($source))) { + $isPartialUploadFile = dirname($source) === dirname($target) + && strpos($source, '.ocTransferId') > 0; + + if ( + !($isPartialUploadFile + || $this->isUpdatable($source) + || $this->isDeletable($source) + ) + ) { return false; }