From 8aed8e4323a88ff423cfe417bdda8e8e9ef5d227 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/private/Files/Storage/Wrapper/PermissionsMask.php b/lib/private/Files/Storage/Wrapper/PermissionsMask.php index 5dbedc76b8d18..4317358ff6792 100644 --- a/lib/private/Files/Storage/Wrapper/PermissionsMask.php +++ b/lib/private/Files/Storage/Wrapper/PermissionsMask.php @@ -71,8 +71,10 @@ public function getPermissions(string $path): int { #[\Override] 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) { - return $this->checkMask(Constants::PERMISSION_CREATE) && parent::rename($source, $target); + $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) && parent::rename($source, $target); }