Skip to content

Ignore exception when deleting keys of deleted user#26968

Merged
PVince81 merged 2 commits into
masterfrom
enc-properly-deletekeys
Jan 19, 2017
Merged

Ignore exception when deleting keys of deleted user#26968
PVince81 merged 2 commits into
masterfrom
enc-properly-deletekeys

Conversation

@PVince81

Copy link
Copy Markdown
Contributor

Description

Reverts #26938 and provides an alternative solution.
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.

Related Issue

See #26824 (comment)
and #26935

Motivation and Context

How Has This Been Tested?

Enable encryption with or without "alternative home" mode.
Create then delete a user.

Before this fix:

  • in normal encryption mode, NoUserException appears in log
  • in alternative home mode: no exception

After this fix: no exception in both modes.

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.

@jvillafanez please review

Vincent Petry added 2 commits January 18, 2017 17:02
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.
@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.

@jvillafanez

Copy link
Copy Markdown
Member

Other than logging something in case the user isn't found, the rest looks good 👍

@PVince81

Copy link
Copy Markdown
Contributor Author

It's not a good idea to log here because there will be a log for every user deletion then and it will spam the log, might be interpreted as a problem by admins.

@jvillafanez

Copy link
Copy Markdown
Member

Hmmm, you have a point. Maybe we should think about how to improve the logging in order to trace what's happening without spamming the log file too much (outside of this PR's scope, obviously)

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

3 participants