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

[stable9.1] Setupfs before access a users keys #26824

Merged
merged 8 commits into from
Jan 20, 2017

Conversation

DeepDiver1975
Copy link
Member

port of #26820

@PVince81
Copy link
Contributor

PVince81 commented Jan 9, 2017

Cherry-picked the additional commit

@PVince81
Copy link
Contributor

Looks like we still have some unit test failures.

Automated tests will be added as part of #26844.
I could already confirm that some tests had failed with alternate home + encryption and this PR here solves them.

@PVince81
Copy link
Contributor

Cherry-picked additional test fixes from the master branch.

@jvillafanez please review

@PVince81
Copy link
Contributor

Argh, need to replace createMock with getMock. Will do...

@PVince81 PVince81 force-pushed the setupfs-before-access-a-users-keys-stable9.1 branch from 4bcd7bd to 54eefbd Compare January 13, 2017 09:03
@PVince81
Copy link
Contributor

Okay, should be good to go now.

@jvillafanez
Copy link
Member

👍

@PVince81
Copy link
Contributor

Let's wait before merging. Need to investigate this (not-so-critical-but-still) regression #26935

@PVince81
Copy link
Contributor

Parse error: ./tests/lib/Encryption/Keys/StorageTest.php:72

    70| 			->getMock();

    71| 

  > 72| 		$user = $this->getMock(IUser::class);

    73| 		$user->method('getUID')->willReturn('user1');

    74| 		$userSession = $this->getMock(IUserSession::class);

Unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'

I'll adjust this later when rebasing.

@PVince81
Copy link
Contributor

PVince81 commented Jan 13, 2017

@felixboehm
Copy link
Contributor

fix works fine in my production environment

@PVince81 PVince81 force-pushed the setupfs-before-access-a-users-keys-stable9.1 branch from 54eefbd to a18a264 Compare January 16, 2017 18:16
@PVince81
Copy link
Contributor

Need rereview, I cherry-picked backports of master to fix a regression and incomplete cases.

@jvillafanez
Copy link
Member

My only worry is that this should be done after deleting the user. If the user isn't deleted, we'd already have deleted the keys with the current code.

Maybe if the keys are stored in the user's home and we can't access to it, we could suppose the keys are already deleted. If they're stored elsewhere we can delete them without problem after the user is deleted.

@PVince81
Copy link
Contributor

Hmm, then I should revert #26938 and find a better way

@PVince81
Copy link
Contributor

PVince81 commented Jan 18, 2017

  • revert preDelete fix and find a better solution
  • fix PHP 5.4 syntax error
Parse error: ./tests/lib/Encryption/Keys/StorageTest.php:296

    294| 			->willReturn(true);

    295| 

  > 296| 		$user = $this->createMock(IUser::class);

    297| 		$user->method('getUID')->willReturn('user1');

    298| 		$userSession = $this->createMock(IUserSession::class);

Unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'

@PVince81
Copy link
Contributor

@jvillafanez please review #26968 with an alternative solution to the preDelete problem. Have to revert and refix on master before I can cherry-pick the new solution here.

Vincent Petry added 5 commits January 19, 2017 09:55
When encryption keys are stored outside the user's homes, there is no
need to mount said homes.
Whenever a user was deleted for encryption where the keys are stored in
the home, we can ignore user existence exceptions because it means the
keys are already gone.
@PVince81 PVince81 force-pushed the setupfs-before-access-a-users-keys-stable9.1 branch from a18a264 to 9ccc59b Compare January 19, 2017 08:55
@PVince81
Copy link
Contributor

Rebased and removed the "preDelete" commit and cherry-picked the better fix from #26968

@PVince81
Copy link
Contributor

PVince81 commented Jan 19, 2017

After all these additions, let's retest this:

  • TEST: sharing with alt home works
  • TEST: delete user works with no warnings
  • TEST: delete user works with no warnings when using alternative key storage

@PVince81
Copy link
Contributor

@PVince81
Copy link
Contributor

Parse error: ./tests/lib/Encryption/Keys/StorageTest.php:296

    294| 			->willReturn(true);

    295| 

  > 296| 		$user = $this->createMock(IUser::class);

    297| 		$user->method('getUID')->willReturn('user1');

    298| 		$userSession = $this->createMock(IUserSession::class);

Unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'

😢

@PVince81
Copy link
Contributor

Integrations test backport pending to be merged #26976

@jvillafanez
Copy link
Member

Changes look good 👍

@PVince81 PVince81 merged commit c580934 into stable9.1 Jan 20, 2017
@PVince81 PVince81 deleted the setupfs-before-access-a-users-keys-stable9.1 branch January 20, 2017 09:11
@lock
Copy link

lock bot commented Aug 4, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants