diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2016-04-01 21:05:55 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2016-04-01 21:05:55 +0200 |
commit | 3dac3a01c5008f1fcec37689e6e02845bd126db8 (patch) | |
tree | 7addba6840e2a1f4e850cdf61a83eae52d48366f /apps | |
parent | cce619436807af3127542a9c73b9d2d85f9327bd (diff) | |
download | nextcloud-server-3dac3a01c5008f1fcec37689e6e02845bd126db8.tar.gz nextcloud-server-3dac3a01c5008f1fcec37689e6e02845bd126db8.zip |
Unmount the share before deleting it, so we don't try to use it later on
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/command/transferownership.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/apps/files/command/transferownership.php b/apps/files/command/transferownership.php index 3674727b167..98dbc428220 100644 --- a/apps/files/command/transferownership.php +++ b/apps/files/command/transferownership.php @@ -203,9 +203,15 @@ class TransferOwnership extends Command { private function restoreShares(OutputInterface $output) { $output->writeln("Restoring shares ..."); $progress = new ProgressBar($output, count($this->shares)); + $mountManager = Filesystem::getMountManager($this->destinationUser); foreach($this->shares as $share) { if ($share->getSharedWith() === $this->destinationUser) { + // Unmount the shares before deleting, so we don't try to get the storage later on. + $shareMountPoint = $mountManager->find('/' . $this->destinationUser . '/files' . $share->getTarget()); + if ($shareMountPoint) { + $mountManager->removeMount($shareMountPoint->getMountPoint()); + } $this->shareManager->deleteShare($share); } else { if ($share->getShareOwner() === $this->sourceUser) { |