-
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
Setupfs before access a users keys #26917
Conversation
@PVince81, thanks for your PR! By analyzing the history of the files in this pull request, we identified @DeepDiver1975 to be a potential reviewer. |
Repasting the steps here because it's a long way to find them: Steps
Before this fix: public key exception |
@@ -64,6 +67,11 @@ public function __construct(View $view, Util $util) { | |||
$this->encryption_base_dir = '/files_encryption'; | |||
$this->keys_base_dir = $this->encryption_base_dir .'/keys'; | |||
$this->root_dir = $this->util->getKeyStorageRoot(); | |||
|
|||
$session = \OC::$server->getUserSession(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it would be a pain to inject this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, apparently not. This class is only in one place in server.php, so I'll add it.
* | ||
* @param string $uid user id | ||
*/ | ||
protected function setupUserMounts($uid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this function should return something to check the result of the initMountPoint (if any) or to check if the function is ignoring the request because the uid matches the current user or the mount point is already mounted, specially if there are plans to unittest this function.
Since it isn't public we might skip testing this.
@@ -55,6 +67,8 @@ public function setUp() { | |||
->disableOriginalConstructor() | |||
->getMock(); | |||
|
|||
$this->createUser('user1', '123456'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this will create a user each time a test runs, which seems wrong.
Either you create the users in the setUpBeforeClass
method (and maybe delete them in the tearDownAfterClass
method) or you delete them in the tearDown
method so the next tests recreate them without any problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, I forgot to re-delete the user. Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the code. Apparently createUser
comes from UserTrait
which itself uses the Dummy
user backend which is reset after every test. So no need for additional changes here.
Works using detailed steps from #26917 (comment) Used displayName as special home folder rule. |
Setting back to "Developing". I'll address @jvillafanez's relevant comments. |
@jvillafanez adjusted, please recheck. I only indirectly tested the |
👍 |
|
First regression already... #26935 |
First missing piece to properly deal with "alternative keys storage root" in which case we don't need to mount anything, see #26937 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Forward port of #26824 to master.
I've retested with the md5 home hack and it works fine.
Automated test will appear when #26844 gets merged.
We should first merge this encryption fix before we can merge the tests PR to avoid failures.
Please review @DeepDiver1975 @jvillafanez @SergioBertolinSG