couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r906140 - in /couchdb/trunk: share/www/script/test/security_validation.js src/couchdb/couch_db.erl
Date Wed, 03 Feb 2010 17:29:46 GMT
Author: jchris
Date: Wed Feb  3 17:29:46 2010
New Revision: 906140

URL: http://svn.apache.org/viewvc?rev=906140&view=rev
Log:
error message on bad security object

Modified:
    couchdb/trunk/share/www/script/test/security_validation.js
    couchdb/trunk/src/couchdb/couch_db.erl

Modified: couchdb/trunk/share/www/script/test/security_validation.js
URL: http://svn.apache.org/viewvc/couchdb/trunk/share/www/script/test/security_validation.js?rev=906140&r1=906139&r2=906140&view=diff
==============================================================================
--- couchdb/trunk/share/www/script/test/security_validation.js (original)
+++ couchdb/trunk/share/www/script/test/security_validation.js Wed Feb  3 17:29:46 2010
@@ -187,6 +187,12 @@
       T(db.setDbProperty("_security", {admin_override : true}).ok);
       T(db.save(doc).ok);
 
+      // try to do something lame
+      try {
+        db.setDbProperty("_security", ["foo"]);
+        T(false && "can't do this");
+      } catch(e) {}
+
       // go back to normal
       T(db.setDbProperty("_security", {admin_override : false}).ok);
 

Modified: couchdb/trunk/src/couchdb/couch_db.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_db.erl?rev=906140&r1=906139&r2=906140&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_db.erl (original)
+++ couchdb/trunk/src/couchdb/couch_db.erl Wed Feb  3 17:29:46 2010
@@ -294,7 +294,9 @@
 set_security(#db{security=SecProps, update_pid=Pid}=Db, {SecObjProps}) when is_list(SecObjProps)
->
     check_is_admin(Db),
     SecProps2 = update_sec_field(sec_obj, SecProps, {SecObjProps}),
-    gen_server:call(Pid, {set_security, SecProps2}, infinity).
+    gen_server:call(Pid, {set_security, SecProps2}, infinity);
+set_security(_, _) ->
+    throw(bad_request).
 
 update_sec_field(Field, SecProps, Value) ->
     Admins = proplists:get_value(admins, SecProps, {[]}),



Mime
View raw message