Use preDelete hook to delete encryption keys#26938
Merged
Merged
Conversation
Because we sometimes need to mount the user's home before deleting encryption keys, this must happen in a preDelete hook because the postDelete is too late. In postDelete the user's home already doesn't exist any more and cannot be mounted.
|
@PVince81, thanks for your PR! By analyzing the history of the files in this pull request, we identified @DeepDiver1975 to be a potential reviewer. |
This was referenced Jan 13, 2017
Contributor
|
I've run integration tests with this PR, works, no more exceptions. |
Contributor
|
👍 make sense |
This was referenced Jan 13, 2017
Contributor
Author
|
@jvillafanez spoke against this change here #26824 (comment), so I reverted it with a new simpler fix, here: #26968 |
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Because we sometimes need to mount the user's home before deleting
encryption keys, this must happen in a preDelete hook because the
postDelete is too late. In postDelete the user's home already doesn't
exist any more and cannot be mounted.
Related Issue
Fixes #26935 which is a regression from #26917
Motivation and Context
To fix the regression from #26917
How Has This Been Tested?
Enable encryption then delete a user.
Before the fix: errors in log
NoUserException.After this fix: no more errors.
Screenshots (if appropriate):
Types of changes
Checklist:
Notes
One might argue that it's pointless to process the keys from the home since the home is deleted anyway. However, this here is only for out own default implementation of encryption key manager. Custom implementations could want to do things like backing up encryption keys before the user is deleted, in which case the preDelete hook makes even more sense.
Please review @jvillafanez @SergioBertolinSG
@SergioBertolinSG this should fix the failures in #26844