summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2020-06-19 16:25:49 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-07-09 12:33:19 +0000
commitf174fb91e0cf1774bff14bc2526d3c62ffdb806a (patch)
tree190caac711fe1372d74b0749422fb1940d53645e /lib
parentb19525ebbcc8fdd72e7579a3760bf0fe6f10ee24 (diff)
downloadnextcloud-server-f174fb91e0cf1774bff14bc2526d3c62ffdb806a.tar.gz
nextcloud-server-f174fb91e0cf1774bff14bc2526d3c62ffdb806a.zip
Use the correct mountpoint to calculate
If we use the owners mount point this results in null. And then the rest of the checks get called with null. Which doesn't work. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Share20/Manager.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/private/Share20/Manager.php b/lib/private/Share20/Manager.php
index 04093278694..f51bf87ee43 100644
--- a/lib/private/Share20/Manager.php
+++ b/lib/private/Share20/Manager.php
@@ -298,13 +298,20 @@ class Manager implements IManager {
$isFederatedShare = $share->getNode()->getStorage()->instanceOfStorage('\OCA\Files_Sharing\External\Storage');
$permissions = 0;
- $mount = $share->getNode()->getMountPoint();
+
+ $userMounts = $userFolder->getById($share->getNode()->getId());
+ $userMount = array_shift($userMounts);
+ $mount = $userMount->getMountPoint();
if (!$isFederatedShare && $share->getNode()->getOwner() && $share->getNode()->getOwner()->getUID() !== $share->getSharedBy()) {
// When it's a reshare use the parent share permissions as maximum
$userMountPointId = $mount->getStorageRootId();
$userMountPoints = $userFolder->getById($userMountPointId);
$userMountPoint = array_shift($userMountPoints);
+ if ($userMountPoint === null) {
+ throw new GenericShareException('Could not get proper user mount for ' . $userMountPointId . '. Failing since else the next calls are called with null');
+ }
+
/* Check if this is an incoming share */
$incomingShares = $this->getSharedWith($share->getSharedBy(), Share::SHARE_TYPE_USER, $userMountPoint, -1, 0);
$incomingShares = array_merge($incomingShares, $this->getSharedWith($share->getSharedBy(), Share::SHARE_TYPE_GROUP, $userMountPoint, -1, 0));