summaryrefslogtreecommitdiffstats
path: root/apps/files
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-07-23 09:47:24 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-08-07 09:09:01 +0200
commit5da4e4dc537e9dba477c18eb71f6246fad43302d (patch)
treee82efcd0b31a65c492a0c4813cdc691dda849e86 /apps/files
parentf6c8668a7e230066feff98ee58c8405f70ba94f7 (diff)
downloadnextcloud-server-5da4e4dc537e9dba477c18eb71f6246fad43302d.tar.gz
nextcloud-server-5da4e4dc537e9dba477c18eb71f6246fad43302d.zip
Fix transfering ownership of a share to user with same id as receiver
When the ownership of a user share is transfered to the receiver the share is removed, as the receiver now owns the original file. However, due to a missing condition, any share with a group, link or remote with the same id as the user was removed, not only the user shares. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'apps/files')
-rw-r--r--apps/files/lib/Command/TransferOwnership.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/files/lib/Command/TransferOwnership.php b/apps/files/lib/Command/TransferOwnership.php
index d175f66d171..6113f6df54c 100644
--- a/apps/files/lib/Command/TransferOwnership.php
+++ b/apps/files/lib/Command/TransferOwnership.php
@@ -263,7 +263,8 @@ class TransferOwnership extends Command {
foreach($this->shares as $share) {
try {
- if ($share->getSharedWith() === $this->destinationUser) {
+ if ($share->getShareType() === \OCP\Share::SHARE_TYPE_USER &&
+ $share->getSharedWith() === $this->destinationUser) {
// Unmount the shares before deleting, so we don't try to get the storage later on.
$shareMountPoint = $this->mountManager->find('/' . $this->destinationUser . '/files' . $share->getTarget());
if ($shareMountPoint) {