-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Fix issue with personal mount points and sharing #8293
Conversation
An issue existed where `readData` used `OCP\User::getUser()` to get the user for personal mount points, which worked in all situations apart from when a personal mount point was used for sharing, so the return from `getUser()` is not the user that owns the share. As such, any personal mount points would not work correctly when shared. `readData` and `writeData` have been changed from using a `$isPersonal` boolean to using a `$user` string|null. `$isPersonal = false` can now be written as `$user = NULL` (or left out in the case of `readData`), and `$isPersonal = true` can be written as `$user = OCP\User::getUser()`.
The inspection completed: 1 new issues, 8 updated code elements |
🚀 Test Passed. 🚀 |
@schiesbn |
@Xenopathic can you tell me the steps you performed to test it? I tried following:
I run into multiple problem, to be fair they seems to be not directly connected to your changes:
( I removed the check to be able to test this branch and shared the /ftp folder successfully)
Both problems exists on master and on your branch, so I can't test your changes but I also wonder how it worked for you? Can you look into this issues, also if they are not directly related to your PR? |
@schiesbn The problem can be replicated as follows:
You shouldn't be able to access that folder, and |
I'll have a look at this |
@Xenopathic I tried your steps: You might want to rebase this branch onto master to get the latest state of the sharing code. The "Shared" folder has been removed and shares can now be moved freely 😄 👍 |
@PVince81 so this PR fixes the issue, even with the new 'free' shared directories? I don't see any reason to rebase if this is the case, since this only touches code in @schiesbn any luck testing this out? |
Yes it does work with the new approach. If you don't rebase then I suggest that the potential testers use the "merge master into this branch" locally to test, to make sure it will work with the latest work. Recently I decided to always go this route to make sure that merged code will also work on master. |
@icewind1991 @schiesbn can you review this as well ? Thanks. |
Code looks good 👍 |
Thanks, but you haven't seen how good the unit test will look 😉 |
@PVince81 Do you want me to do the unit test or are you doing it? I wasn't aware this needed one... |
Sorry, I commented in the wrong ticket... didn't have ☕ this morning. |
Fix issue with personal mount points and sharing
@karlitschek @craigpg we need to backport this to OC 6 to fix #9535 That issue on OC 6 has been introduced by the backport of the password obfuscation code which brought in additional required changes. |
Backport PR is here: #9635 |
An issue existed where
readData
usedOCP\User::getUser()
to get the user for personal mount points, which worked in all situations apart from when a personal mount point was used for sharing, so the return fromgetUser()
is not the user that owns the share. As such, any personal mount points would not work correctly when shared.readData
andwriteData
have been changed from using a$isPersonal
boolean to using a$user
string|null.$isPersonal = false
can now be written as$user = NULL
(or left out in the case ofreadData
), and$isPersonal = true
can be written as$user = OCP\User::getUser()
.This PR fixes the sharing issues encountered in #8167.