Skip to content

Use preDelete hook to delete encryption keys#26938

Merged
PVince81 merged 1 commit into
masterfrom
enc-predelete-user
Jan 13, 2017
Merged

Use preDelete hook to delete encryption keys#26938
PVince81 merged 1 commit into
masterfrom
enc-predelete-user

Conversation

@PVince81

Copy link
Copy Markdown
Contributor

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

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

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.
@mention-bot

Copy link
Copy Markdown

@PVince81, thanks for your PR! By analyzing the history of the files in this pull request, we identified @DeepDiver1975 to be a potential reviewer.

@SergioBertolinSG

SergioBertolinSG commented Jan 13, 2017

Copy link
Copy Markdown
Contributor

I've run integration tests with this PR, works, no more exceptions.

@VicDeo

VicDeo commented Jan 13, 2017

Copy link
Copy Markdown
Contributor

👍 make sense

@PVince81

Copy link
Copy Markdown
Contributor Author

@jvillafanez spoke against this change here #26824 (comment), so I reverted it with a new simpler fix, here: #26968

@lock

lock Bot commented Aug 4, 2019

Copy link
Copy Markdown

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.

Encryption key storage error when deleting user

4 participants