summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2020-06-11 14:22:59 +0200
committerRobin Appelman <robin@icewind.nl>2020-06-24 13:06:14 +0200
commit35d75dbb384dcaa032cddf30c5f53dcea293e507 (patch)
treeed0d5a8c0c8462825f1bba87ef4a320aaab90c24 /lib
parent8ec1b8132efed59a0f4b6ad49b99dfa5dd23424c (diff)
downloadnextcloud-server-35d75dbb384dcaa032cddf30c5f53dcea293e507.tar.gz
nextcloud-server-35d75dbb384dcaa032cddf30c5f53dcea293e507.zip
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 <robin@icewind.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Storage/Wrapper/PermissionsMask.php10
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/private/Files/Storage/Wrapper/PermissionsMask.php b/lib/private/Files/Storage/Wrapper/PermissionsMask.php
index 6b453b4380a..9c2d123b7bf 100644
--- a/lib/private/Files/Storage/Wrapper/PermissionsMask.php
+++ b/lib/private/Files/Storage/Wrapper/PermissionsMask.php
@@ -80,13 +80,9 @@ class PermissionsMask extends Wrapper {
}
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);
}