Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 77702 invoked from network); 6 Apr 2011 06:07:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 6 Apr 2011 06:07:48 -0000 Received: (qmail 20829 invoked by uid 500); 6 Apr 2011 06:07:48 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 20639 invoked by uid 500); 6 Apr 2011 06:07:47 -0000 Mailing-List: contact dev-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 dev@couchdb.apache.org Received: (qmail 20631 invoked by uid 99); 6 Apr 2011 06:07:46 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Apr 2011 06:07:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Apr 2011 06:07:43 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id DC58F947AE for ; Wed, 6 Apr 2011 06:07:05 +0000 (UTC) Date: Wed, 6 Apr 2011 06:07:05 +0000 (UTC) From: "Denny Trebbin (JIRA)" To: dev@couchdb.apache.org Message-ID: <2064659382.37195.1302070025899.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Created] (COUCHDB-1121) Signup error is shown after creating an administrator account MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org Signup error is shown after creating an administrator account ------------------------------------------------------------- Key: COUCHDB-1121 URL: https://issues.apache.org/jira/browse/COUCHDB-1121 Project: CouchDB Issue Type: Bug Components: Futon Affects Versions: 1.0.2 Environment: Mac OS X 10.6.7, Max OS X 10.7.preview2, Ubuntu 10.10= , all systems are running in x86_64 mode. Reporter: Denny Trebbin Priority: Minor A fresh new installation of CouchDB comes with no pre defined admin account= . Futon shows a little message and provides a Link to fix this. If I try to add an user named as root and give him a password then Futon wi= ll show an error after saving this account. Signup error: {gen_server,call, [couch_query_servers, {get_proc,{doc,<<"_design/_auth">>, {1, [<<196,79,177,42,38,118,212,129,210,53,82,48, 146,224,206,196>>]}, {[{<<"language">>,<<"javascript">>}, {<<"validate_doc_update">>, <<"\n function(newDoc, oldDoc, userCtx) {= \n if (newDoc._deleted =3D=3D=3D true) {\n // allow delet= es by admins and matching users\n // without checking the other = fields\n if ((userCtx.roles.indexOf('_admin') !=3D=3D -1) ||\n = (userCtx.name =3D=3D oldDoc.name)) {\n return;= \n } else {\n throw({forbidden: 'Only admins may = delete other user docs.'});\n }\n }\n\n if ((oldDo= c && oldDoc.type !=3D=3D 'user') || newDoc.type !=3D=3D 'user') {\n = throw({forbidden : 'doc.type must be user'});\n } // we only all= ow user docs for now\n\n if (!newDoc.name) {\n throw({for= bidden: 'doc.name is required'});\n }\n\n if (newDoc.roles &&= !isArray(newDoc.roles)) {\n throw({forbidden: 'doc.roles must b= e an array'});\n }\n\n if (newDoc._id !=3D=3D ('org.couchdb.u= ser:' + newDoc.name)) {\n throw({\n forbidden: 'D= oc ID must be of the form org.couchdb.user:name'\n });\n = }\n\n if (oldDoc) { // validate all updates\n if (oldDoc.= name !=3D=3D newDoc.name) {\n throw({forbidden: 'Usernames c= an not be changed.'});\n }\n }\n\n if (newDoc.pass= word_sha && !newDoc.salt) {\n throw({\n forbidden= : 'Users with password_sha must have a salt.' +\n 'See /= _utils/script/couch.js for example code.'\n });\n }\n\n = if (userCtx.roles.indexOf('_admin') =3D=3D=3D -1) {\n if (= oldDoc) { // validate non-admin updates\n if (userCtx.name != =3D=3D newDoc.name) {\n throw({\n = forbidden: 'You may only update your own user document.'\n = });\n }\n // validate role updates\n = var oldRoles =3D oldDoc.roles.sort();\n var newRo= les =3D newDoc.roles.sort();\n\n if (oldRoles.length !=3D=3D= newRoles.length) {\n throw({forbidden: 'Only _admin may= edit roles'});\n }\n\n for (var i =3D 0; i <= oldRoles.length; i++) {\n if (oldRoles[i] !=3D=3D newRo= les[i]) {\n throw({forbidden: 'Only _admin may edit = roles'});\n }\n }\n } else if = (newDoc.roles.length > 0) {\n throw({forbidden: 'Only _admin= may set roles'});\n }\n }\n\n // no system roles = in users db\n for (var i =3D 0; i < newDoc.roles.length; i++) {\n = if (newDoc.roles[i][0] =3D=3D=3D '_') {\n throw({\n= forbidden:\n 'No system roles (start= ing with underscore) in users db.'\n });\n }\n = }\n\n // no system names as names\n if (newDoc.name[0] = =3D=3D=3D '_') {\n throw({forbidden: 'Username may not start wit= h underscore.'});\n }\n }\n">>}]}, [],false,[]}, {<<"_design/_auth">>, <<"1-c44fb12a2676d481d235523092e0cec4">>}}]} The admin account will be created and I can log in with the admin account "= root". This problem showed up every time I installed CouchDB on my machine. On Mac OS I used Homebrew ($ brew install couchdb) to install CouchDB which= downloads all the sources, compiles them and install properly. On my Linux= machine I've followed the compile instructions from the Wiki page. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira