Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 78867 invoked from network); 29 Jul 2010 06:10:22 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Jul 2010 06:10:22 -0000 Received: (qmail 77588 invoked by uid 500); 29 Jul 2010 06:10:22 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 77461 invoked by uid 500); 29 Jul 2010 06:10:19 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 77454 invoked by uid 99); 29 Jul 2010 06:10:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jul 2010 06:10:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Jul 2010 06:10:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 79A9123889E9; Thu, 29 Jul 2010 06:09:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r980321 - in /couchdb/branches/0.11.x: share/www/script/test/security_validation.js src/couchdb/couch_db.erl Date: Thu, 29 Jul 2010 06:09:01 -0000 To: commits@couchdb.apache.org From: jchris@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100729060901.79A9123889E9@eris.apache.org> Author: jchris Date: Thu Jul 29 06:09:00 2010 New Revision: 980321 URL: http://svn.apache.org/viewvc?rev=980321&view=rev Log: fix the underlying issue that was giving replication problems attempting to push design docs as a non-admin. this is what my reverted commit should have been Modified: couchdb/branches/0.11.x/share/www/script/test/security_validation.js couchdb/branches/0.11.x/src/couchdb/couch_db.erl Modified: couchdb/branches/0.11.x/share/www/script/test/security_validation.js URL: http://svn.apache.org/viewvc/couchdb/branches/0.11.x/share/www/script/test/security_validation.js?rev=980321&r1=980320&r2=980321&view=diff ============================================================================== --- couchdb/branches/0.11.x/share/www/script/test/security_validation.js (original) +++ couchdb/branches/0.11.x/share/www/script/test/security_validation.js Thu Jul 29 06:09:00 2010 @@ -111,6 +111,18 @@ couchTests.security_validation = functio T(userDb.save(designDoc).ok); + var user2Db = new CouchDB("test_suite_db", + {"WWW-Authenticate": "X-Couch-Test-Auth Jan Lehnardt:apple"} + ); + // Attempt to save the design as a non-admin (in replication scenario) + try { + user2Db.save(designDoc, {new_edits : false}); + T(false && "Can't get here. Should have thrown an error on design doc"); + } catch (e) { + T(e.error == "unauthorized"); + T(user2Db.last_req.status == 401); + } + // test the _session API var resp = userDb.request("GET", "/_session"); var user = JSON.parse(resp.responseText).userCtx; @@ -134,10 +146,6 @@ couchTests.security_validation = functio } // Now attempt to update the document as a different user, Jan - var user2Db = new CouchDB("test_suite_db", - {"WWW-Authenticate": "X-Couch-Test-Auth Jan Lehnardt:apple"} - ); - var doc = user2Db.open("testdoc"); doc.foo=3; try { Modified: couchdb/branches/0.11.x/src/couchdb/couch_db.erl URL: http://svn.apache.org/viewvc/couchdb/branches/0.11.x/src/couchdb/couch_db.erl?rev=980321&r1=980320&r2=980321&view=diff ============================================================================== --- couchdb/branches/0.11.x/src/couchdb/couch_db.erl (original) +++ couchdb/branches/0.11.x/src/couchdb/couch_db.erl Thu Jul 29 06:09:00 2010 @@ -368,6 +368,8 @@ update_doc(Db, Doc, Options, UpdateType) case update_docs(Db, [Doc], Options, UpdateType) of {ok, [{ok, NewRev}]} -> {ok, NewRev}; + {ok, [{{_Id, _Rev}, Error}]} -> + throw(Error); {ok, [Error]} -> throw(Error); {ok, []} ->