couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject [7/9] couch-mrview commit: updated refs/heads/master to 065dc26
Date Fri, 30 Jan 2015 18:11:00 GMT
Forbid access to _local_docs for non-system dbs

COUCHDB-1145


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

Branch: refs/heads/master
Commit: 9e249858b4c942d841faa75953e549fcd044b33d
Parents: 0828a39
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Wed Dec 31 11:32:58 2014 -0800
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Wed Dec 31 11:33:17 2014 -0800

----------------------------------------------------------------------
 src/couch_mrview_http.erl | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-couch-mrview/blob/9e249858/src/couch_mrview_http.erl
----------------------------------------------------------------------
diff --git a/src/couch_mrview_http.erl b/src/couch_mrview_http.erl
index 75e2c54..dc50f59 100644
--- a/src/couch_mrview_http.erl
+++ b/src/couch_mrview_http.erl
@@ -180,7 +180,7 @@ all_docs_req(Req, Db, Keys) ->
     all_docs_req(Req, Db, Keys, undefined).
 
 all_docs_req(Req, Db, Keys, NS) ->
-    case couch_db:is_system_db(Db) of
+    case is_restricted(Db, NS) of
     true ->
         case (catch couch_db:check_is_admin(Db)) of
         ok ->
@@ -200,6 +200,11 @@ all_docs_req(Req, Db, Keys, NS) ->
         do_all_docs_req(Req, Db, Keys, NS)
     end.
 
+is_restricted(_Db, <<"_local">>) ->
+    true;
+is_restricted(Db, _) ->
+    couch_db:is_system_db(Db).
+
 is_public_fields_configured(Db) ->
     DbName = ?b2l(Db#db.name),
     case config:get("couch_httpd_auth",


Mime
View raw message