Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
relax permissions mask check for detecting part file rename
with files drop uploads the original file name isn't always used for the '.ocTransferId' source path

Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and backportbot[bot] committed Jun 24, 2020
commit a2ebe6d30ef7c59cfd1851b367e8c48f28d5823a
10 changes: 3 additions & 7 deletions lib/private/Files/Storage/Wrapper/PermissionsMask.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,9 @@ public function getPermissions($path) {
}

public function rename($path1, $path2) {
$p = strpos($path1, $path2);
if ($p === 0) {
$part = substr($path1, strlen($path2));
//This is a rename of the transfer file to the original file
if (strpos($part, '.ocTransferId') === 0) {
return $this->checkMask(Constants::PERMISSION_CREATE) and parent::rename($path1, $path2);
}
//This is a rename of the transfer file to the original file
if (dirname($path1) === dirname($path2) && strpos($path1, '.ocTransferId') > 0) {
return $this->checkMask(Constants::PERMISSION_CREATE) and parent::rename($path1, $path2);
}
return $this->checkMask(Constants::PERMISSION_UPDATE) and parent::rename($path1, $path2);
}
Expand Down