Repository: couchdb-couch Updated Branches: refs/heads/2452-users-db-security-on-clustered-interface [created] 8c0299645
Add _users DB callbacks when opening _users shards The test to determine whether to add the callback functions for _users DB operations was only checking the raw database name. When using the authentication DB on the clustered database this meant that this test would fail and the callbacks would not be added. This commit checks the DB name (rather than the shard name) against the value of chttpd_auth/authentication_db so that shards for clustered authentication DBs have the appropriate callbacks added. COUCHDB-2452 Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/2f069c8b Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/2f069c8b Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/2f069c8b Branch: refs/heads/2452-users-db-security-on-clustered-interface Commit: 2f069c8b9ed80f0a63487044c5e001c8bd8a92d1 Parents: cb52507 Author: Mike Wallace <[email protected]> Authored: Mon Nov 10 23:59:07 2014 +0000 Committer: Mike Wallace <[email protected]> Committed: Tue Nov 11 00:04:27 2014 +0000 ---------------------------------------------------------------------- src/couch_server.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/2f069c8b/src/couch_server.erl ---------------------------------------------------------------------- diff --git a/src/couch_server.erl b/src/couch_server.erl index 8f9696b..fa0a5ea 100644 --- a/src/couch_server.erl +++ b/src/couch_server.erl @@ -124,7 +124,8 @@ maybe_add_sys_db_callbacks(DbName, Options) -> IsReplicatorDb = DbName == config:get("replicator", "db", "_replicator") orelse path_ends_with(DbName, <<"_replicator">>), IsUsersDb = DbName ==config:get("couch_httpd_auth", "authentication_db", "_users") orelse - path_ends_with(DbName, <<"_users">>), + path_ends_with(DbName, <<"_users">>) orelse + binary_to_list(mem3:dbname(DbName)) == config:get("chttpd_auth", "authentication_db", "_users"), if DbName == DbsDbName -> [sys_db | Options];
