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

Auth: JSON backend truncates file on errors #80

Open
dlichtenberger opened this issue Apr 13, 2013 · 1 comment
Open

Auth: JSON backend truncates file on errors #80

dlichtenberger opened this issue Apr 13, 2013 · 1 comment

Comments

@dlichtenberger
Copy link

I accidently tried to update a user's password in Snap 0.11.2 with
saveUser (user { userPassword = Just (ClearText "...") } )
instead of using the encrypted password.
The JSON backend throws the error "ClearText passwords can't be serialized into JSON" and truncates the users.json file at the location where the encrypted password would have been written.

@ozataman
Copy link
Member

Sounds like laziness biting us in the neck here. We need to move that check up to before anything is written to disk.

On Apr 13, 2013, at 6:57 AM, Daniel Lichtenberger [email protected] wrote:

I accidently tried to update a user's password in Snap 0.11.2 with
saveUser (user { userPassword = Just (ClearText "...") } )
instead of using the encrypted password.
The JSON backend throws the error "ClearText passwords can't be serialized into JSON" and truncates the users.json file at the location where the encrypted password would have been written.


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants