couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikewall...@apache.org
Subject [1/4] couch commit: updated refs/heads/2452-users-db-security-on-clustered-interface to 4e24b4c
Date Fri, 14 Nov 2014 19:35:04 GMT
Repository: couchdb-couch
Updated Branches:
  refs/heads/2452-users-db-security-on-clustered-interface 8c0299645 -> 4e24b4cae (forced
update)


Add _users DB callbacks when opening _users shards

The check 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 check 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 1/3


Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/cad071cc
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/cad071cc
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/cad071cc

Branch: refs/heads/2452-users-db-security-on-clustered-interface
Commit: cad071cc0b5018bfd355ef49de8941e2d545900a
Parents: cb52507
Author: Mike Wallace <mikewallace@apache.org>
Authored: Mon Nov 10 23:59:07 2014 +0000
Committer: Mike Wallace <mikewallace@apache.org>
Committed: Fri Nov 14 18:20:51 2014 +0000

----------------------------------------------------------------------
 src/couch_server.erl | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/cad071cc/src/couch_server.erl
----------------------------------------------------------------------
diff --git a/src/couch_server.erl b/src/couch_server.erl
index 8f9696b..71e96db 100644
--- a/src/couch_server.erl
+++ b/src/couch_server.erl
@@ -124,7 +124,9 @@ 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];


Mime
View raw message