[GitHub] couchdb-couch pull request #62: Make sure authentication_db for clustered is...

2016-09-13 Thread iilyak
Github user iilyak closed the pull request at:

https://github.com/apache/couchdb-couch/pull/62


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] couchdb-couch pull request #62: Make sure authentication_db for clustered is...

2016-09-12 Thread davisp
Github user davisp commented on a diff in the pull request:

https://github.com/apache/couchdb-couch/pull/62#discussion_r78438428
  
--- Diff: src/couch_server.erl ---
@@ -116,12 +116,16 @@ delete(DbName, Options) ->
 maybe_add_sys_db_callbacks(DbName, Options) when is_binary(DbName) ->
 maybe_add_sys_db_callbacks(?b2l(DbName), Options);
 maybe_add_sys_db_callbacks(DbName, Options) ->
+Normalized = couch_db:normalize_dbname(DbName),
+IsShard = couch_db:is_shard(DbName),
+
 DbsDbName = config:get("mem3", "shards_db", "_dbs"),
 NodesDbName = config:get("mem3", "nodes_db", "_nodes"),
-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">>),
+IsReplicatorDb = Normalized == config:get("replicator", "db", 
"_replicator") orelse
--- End diff --

As I read this, Normalized is guaranteed to be a binary, where config:get/3 
is guaranteed to be a list, so the first part of the orelse is guaranteed to be 
false.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---