From 0aaa20bcf94afbb11515b1d187a61dc38eac6e18 Mon Sep 17 00:00:00 2001 From: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> Date: Thu, 6 Aug 2026 18:15:53 +0200 Subject: [PATCH] fix: allow file request upload when `part_file_in_storage=false` The part_file_in_storage option being disabled, causes files to be uploaded in the user's root, rather than in the final directory. This, in combination with the use of upload nicknames, was not detected by the patched check, causing uploads to check for the UPDATE permissions, which is not granted for file requests, making all uploads always fail. Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> --- lib/private/Files/Storage/Wrapper/PermissionsMask.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/private/Files/Storage/Wrapper/PermissionsMask.php b/lib/private/Files/Storage/Wrapper/PermissionsMask.php index b025476f3a45e..4eb0359699bcc 100644 --- a/lib/private/Files/Storage/Wrapper/PermissionsMask.php +++ b/lib/private/Files/Storage/Wrapper/PermissionsMask.php @@ -62,7 +62,9 @@ public function getPermissions(string $path): int { public function rename(string $source, string $target): bool { //This is a rename of the transfer file to the original file - if (dirname($source) === dirname($target) && strpos($source, '.ocTransferId') > 0) { + $sourceDir = dirname($source); + $targetDir = dirname($target); + if (($sourceDir === $targetDir || $sourceDir === dirname($targetDir)) && strpos($source, '.ocTransferId') > 0) { return $this->checkMask(Constants::PERMISSION_CREATE) and parent::rename($source, $target); } return $this->checkMask(Constants::PERMISSION_UPDATE) and parent::rename($source, $target);