Skip to content

Commit

Permalink
Fix permision mask
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
rullzer committed Oct 22, 2016
1 parent dff0eb9 commit 35f9d3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Empty file.
8 changes: 8 additions & 0 deletions lib/private/Files/Storage/Wrapper/PermissionsMask.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ 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);
}
}
return $this->checkMask(Constants::PERMISSION_UPDATE) and parent::rename($path1, $path2);
}

Expand Down

0 comments on commit 35f9d3c

Please sign in to comment.