Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the correct mountpoint to calculate #21489

Merged
merged 5 commits into from
Jul 9, 2020

Conversation

rullzer
Copy link
Member

@rullzer rullzer commented Jun 19, 2020

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 [email protected]

@rullzer rullzer added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 23, 2020
Copy link
Member

@danxuliu danxuliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 \Exception('Could not get proper user mount for ' . $userMountPointId . '. Failing since else the next calls are called with null');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a GenericShareException, or it should be documented that generalCreateChecks can throw a plain Exception too.

@nickvergessen
Copy link
Member

Looking into the tests now

@nickvergessen
Copy link
Member

Tried my best but this is so … up.
The tests are creating Local storages and initialising the view on them, without going through any layers, so of course when we check the database later on for related storages/mount points the list is empty and therefor the share fails.

@rullzer rullzer force-pushed the fix/share/use_correct_mount branch from 071603f to 25c4591 Compare July 9, 2020 07:01
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦈 Time to fix up

rullzer and others added 5 commits July 9, 2020 11:14
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 <[email protected]>
Signed-off-by: Robin Appelman <[email protected]>
@rullzer rullzer force-pushed the fix/share/use_correct_mount branch from 25c4591 to 118965a Compare July 9, 2020 09:15
@nickvergessen nickvergessen merged commit 183e2ef into master Jul 9, 2020
@nickvergessen nickvergessen deleted the fix/share/use_correct_mount branch July 9, 2020 10:57
@nickvergessen
Copy link
Member

Backports I guess @rullzer

@rullzer
Copy link
Member Author

rullzer commented Jul 9, 2020

Yes

@rullzer
Copy link
Member Author

rullzer commented Jul 9, 2020

/backport to stable19

@rullzer
Copy link
Member Author

rullzer commented Jul 9, 2020

/backport to stable18

@rullzer
Copy link
Member Author

rullzer commented Jul 9, 2020

/backport to stable17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants