Repository: couchdb-fabric Updated Branches: refs/heads/master 9664463d9 -> 5199fdd18
Use list of system database names This closes #15 COUCHDB-2619 COUCHDB-2620 Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/5199fdd1 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/5199fdd1 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/5199fdd1 Branch: refs/heads/master Commit: 5199fdd18f3c048ca9a9ddab95a8aa88fed0be1e Parents: 9664463 Author: Alexander Shorin <[email protected]> Authored: Wed Feb 25 22:03:21 2015 +0300 Committer: Alexander Shorin <[email protected]> Committed: Thu Feb 26 23:24:22 2015 +0300 ---------------------------------------------------------------------- src/fabric_db_create.erl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/5199fdd1/src/fabric_db_create.erl ---------------------------------------------------------------------- diff --git a/src/fabric_db_create.erl b/src/fabric_db_create.erl index 8b9d32a..6678d5b 100644 --- a/src/fabric_db_create.erl +++ b/src/fabric_db_create.erl @@ -45,12 +45,11 @@ validate_dbname(DbName, Options) -> case re:run(DbName, ?DBNAME_REGEX, [{capture,none}, dollar_endonly]) of match -> ok; - nomatch when DbName =:= <<"_users">> -> - ok; - nomatch when DbName =:= <<"_replicator">> -> - ok; nomatch -> - {error, illegal_database_name} + case lists:member(?b2l(DbName), ?SYSTEM_DATABASES) of + true -> ok; + false -> {error, illegal_database_name} + end end end.
