summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-10-22 21:29:14 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-10-24 21:45:00 +0200
commite73a11d1060320917343679b15c126f0076ac46b (patch)
tree3bf1ac09c949938b7a81c4428ee0de0b2f661273
parentf374eb5f1df6f84f94847dae2ee5700436322b50 (diff)
downloadnextcloud-server-e73a11d1060320917343679b15c126f0076ac46b.tar.gz
nextcloud-server-e73a11d1060320917343679b15c126f0076ac46b.zip
Fix permision mask
If we move a file from the temp part file to the original file we don't need update permissions. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r--apps/dav/lib/Files/Sharing/FilesDropPlugin.php0
-rw-r--r--lib/private/Files/Storage/Wrapper/PermissionsMask.php8
2 files changed, 8 insertions, 0 deletions
diff --git a/apps/dav/lib/Files/Sharing/FilesDropPlugin.php b/apps/dav/lib/Files/Sharing/FilesDropPlugin.php
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/apps/dav/lib/Files/Sharing/FilesDropPlugin.php
diff --git a/lib/private/Files/Storage/Wrapper/PermissionsMask.php b/lib/private/Files/Storage/Wrapper/PermissionsMask.php
index 39375602c34..7bcb1087fef 100644
--- a/lib/private/Files/Storage/Wrapper/PermissionsMask.php
+++ b/lib/private/Files/Storage/Wrapper/PermissionsMask.php
@@ -78,6 +78,14 @@ 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);
+ }
+ }
return $this->checkMask(Constants::PERMISSION_UPDATE) and parent::rename($path1, $path2);
}