X Tutup
Skip to content

Allow copying file keys when storage has multiple mount points#39058

Merged
AlexAndBear merged 4 commits intomasterfrom
fix-copy-keys-for-multiple-mount-points
Oct 12, 2021
Merged

Allow copying file keys when storage has multiple mount points#39058
AlexAndBear merged 4 commits intomasterfrom
fix-copy-keys-for-multiple-mount-points

Conversation

@butonic
Copy link
Contributor

@butonic butonic commented Jul 26, 2021

cc @IljaN @cdamken
In the old logic might break when a group share has been mounted by multiple users and files are repeatedly moved in and out of that group share while encryption is enabled.

@update-docs
Copy link

update-docs bot commented Jul 26, 2021

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 1 Code Smell

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@IljaN
Copy link
Contributor

IljaN commented Oct 4, 2021

@janackermann Could your team please take care so this lands in 10.9?

@IljaN
Copy link
Contributor

IljaN commented Oct 4, 2021

Related: #39015

@AlexAndBear
Copy link

@IljaN will take care but #38583 which needs to land in 10.9 also, has a higher prio

@AlexAndBear AlexAndBear force-pushed the fix-copy-keys-for-multiple-mount-points branch from 018d9aa to 078bd58 Compare October 12, 2021 08:23
@butonic
Copy link
Contributor Author

butonic commented Oct 12, 2021

IIRC I tried digging into why findByStorageId returns more than one mount point for a single storageid. AFAICT a group share has child items, one for every user that accepted or renamed the incoming share. When moving files in and out of the share there is a code path that mounts the same underlying storage more than once, but since this happens during the setupFS() I could not dig into the exact reason where the mount manager would add another mount point. The best I could come up with was the storage initialization of source and target when copying the encryption keys.

🤔

From my understanding a cross storage move (initiated by a share recipient) calls

\OC\Files\Filesystem::initMountPoints($uid);
, for the user that shared the folder with a group. This will add a second mount point for the same storage id in addition to the mount point for the currently logged in user. They both have access to the group share, but the paths are different.

@AlexAndBear AlexAndBear requested a review from IljaN October 12, 2021 13:00
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell B 2 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

@AlexAndBear AlexAndBear merged commit 0ba9d15 into master Oct 12, 2021
@delete-merged-branch delete-merged-branch bot deleted the fix-copy-keys-for-multiple-mount-points branch October 12, 2021 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

X Tutup