Repository: couchdb-couch Updated Branches: refs/heads/master 2f3216660 -> 411c130ea
Remove race condition-prone upgrade_on_auth code Hashes are still upgraded on next password change COUCHDB-2991 Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/411c130e Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/411c130e Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/411c130e Branch: refs/heads/master Commit: 411c130ea63c3423d7ea71743095dfb446680da6 Parents: 2f32166 Author: Robert Newson <rnew...@apache.org> Authored: Tue Jun 21 13:03:29 2016 +0100 Committer: Robert Newson <rnew...@apache.org> Committed: Tue Jun 21 13:03:29 2016 +0100 ---------------------------------------------------------------------- src/couch_httpd_auth.erl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/411c130e/src/couch_httpd_auth.erl ---------------------------------------------------------------------- diff --git a/src/couch_httpd_auth.erl b/src/couch_httpd_auth.erl index c305ad9..ff0f73c 100644 --- a/src/couch_httpd_auth.erl +++ b/src/couch_httpd_auth.erl @@ -397,11 +397,9 @@ maybe_value(Key, Else, Fun) -> maybe_upgrade_password_hash(Req, UserName, Password, UserProps, AuthModule, AuthCtx) -> - Upgrade = config:get_boolean("couch_httpd_auth", "upgrade_password_on_auth", true), IsAdmin = lists:member(<<"_admin">>, couch_util:get_value(<<"roles">>, UserProps, [])), - case {IsAdmin, Upgrade, - couch_util:get_value(<<"password_scheme">>, UserProps, <<"simple">>)} of - {false, true, <<"simple">>} -> + case {IsAdmin, couch_util:get_value(<<"password_scheme">>, UserProps, <<"simple">>)} of + {false, <<"simple">>} -> UserProps2 = proplists:delete(<<"password_sha">>, UserProps), UserProps3 = [{<<"password">>, Password} | UserProps2], NewUserDoc = couch_doc:from_json_obj({UserProps3}),