summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-07-02 23:51:03 +0200
committerGitHub <noreply@github.com>2020-07-02 23:51:03 +0200
commitf70b2dba18cc28a176d31ff6e8922b71e03b5929 (patch)
tree6f55366e2600b9f1629a21eb53b2ecb2abc5fb1f
parent79b3923a4270f6bbbbe39eecb2c83c75cda00380 (diff)
parent654f5a2109371ec5f8bb10a792ffa9a995c37e30 (diff)
downloadnextcloud-server-f70b2dba18cc28a176d31ff6e8922b71e03b5929.tar.gz
nextcloud-server-f70b2dba18cc28a176d31ff6e8922b71e03b5929.zip
Merge pull request #21573 from nextcloud/backport/21558/stable19
[stable19] relax permissions mask check for detecting part file rename
-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);
}