diff options
author | Joas Schilling <coding@schilljs.com> | 2017-03-20 12:27:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-20 12:27:38 +0100 |
commit | 35f6b8716e0f4f851e6c5df19b24a1fa76cca5c0 (patch) | |
tree | 5cffd99f112f9b3a949e1a4aafd611f1060d2530 /apps/files_sharing/lib | |
parent | 25f772d592172c40ecbb97db71e9590678eab2a4 (diff) | |
parent | 80d2717e5cb80615c2e75885398c26289fad463c (diff) | |
download | nextcloud-server-35f6b8716e0f4f851e6c5df19b24a1fa76cca5c0.tar.gz nextcloud-server-35f6b8716e0f4f851e6c5df19b24a1fa76cca5c0.zip |
Merge pull request #3884 from nextcloud/downstream-26956
Skip null groups in group manager
Diffstat (limited to 'apps/files_sharing/lib')
-rw-r--r-- | apps/files_sharing/lib/Controller/ShareAPIController.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/lib/MountProvider.php | 18 |
2 files changed, 18 insertions, 2 deletions
diff --git a/apps/files_sharing/lib/Controller/ShareAPIController.php b/apps/files_sharing/lib/Controller/ShareAPIController.php index 711970d0c84..78eef6c26bb 100644 --- a/apps/files_sharing/lib/Controller/ShareAPIController.php +++ b/apps/files_sharing/lib/Controller/ShareAPIController.php @@ -804,7 +804,7 @@ class ShareAPIController extends OCSController { if ($checkGroups && $share->getShareType() === \OCP\Share::SHARE_TYPE_GROUP) { $sharedWith = $this->groupManager->get($share->getSharedWith()); $user = $this->userManager->get($this->currentUser); - if ($user !== null && $sharedWith->inGroup($user)) { + if ($user !== null && $sharedWith !== null && $sharedWith->inGroup($user)) { return true; } } diff --git a/apps/files_sharing/lib/MountProvider.php b/apps/files_sharing/lib/MountProvider.php index f474190fc98..a02d6350499 100644 --- a/apps/files_sharing/lib/MountProvider.php +++ b/apps/files_sharing/lib/MountProvider.php @@ -173,7 +173,23 @@ class MountProvider implements IMountProvider { if ($share->getTarget() !== $superShare->getTarget()) { // adjust target, for database consistency $share->setTarget($superShare->getTarget()); - $this->shareManager->moveShare($share, $user->getUID()); + try { + $this->shareManager->moveShare($share, $user->getUID()); + } catch (\InvalidArgumentException $e) { + // ignore as it is not important and we don't want to + // block FS setup + + // the subsequent code anyway only uses the target of the + // super share + + // such issue can usually happen when dealing with + // null groups which usually appear with group backend + // caching inconsistencies + $this->logger->debug( + 'Could not adjust share target for share ' . $share->getId() . ' to make it consistent: ' . $e->getMessage(), + ['app' => 'files_sharing'] + ); + } } if (!is_null($share->getNodeCacheEntry())) { $superShare->setNodeCacheEntry($share->getNodeCacheEntry()); |