forked from chocolatey/choco
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(chocolatey#2437) Fall back to CurrentUser scope when permission denied
When running on mono on a non-Windows system, the ProtectedData methods use /usr/local/.mono/keypair as the folder to save keypairs. This folder is not normally writable by non-root users, thus erroring when used by a normal user. This catches that error and falls back to using the CurrentUser scope. Also, during data unprotection, it will try to fall back to CurrentUser scope if the decryption fails for other reasons, so as to attempt to decrypt data encrypted with CurrentUser if the LocalSystem scope starts working.
1 parent
c0fbb14
commit a94c572
Showing
1 changed file
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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