Return-Path: Delivered-To: apmail-zookeeper-user-archive@www.apache.org Received: (qmail 30963 invoked from network); 22 Feb 2011 08:34:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Feb 2011 08:34:49 -0000 Received: (qmail 71909 invoked by uid 500); 22 Feb 2011 08:34:49 -0000 Delivered-To: apmail-zookeeper-user-archive@zookeeper.apache.org Received: (qmail 71525 invoked by uid 500); 22 Feb 2011 08:34:46 -0000 Mailing-List: contact user-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@zookeeper.apache.org Delivered-To: mailing list user@zookeeper.apache.org Received: (qmail 71506 invoked by uid 99); 22 Feb 2011 08:34:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Feb 2011 08:34:45 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ride.shoot.speak@googlemail.com designates 74.125.82.46 as permitted sender) Received: from [74.125.82.46] (HELO mail-ww0-f46.google.com) (74.125.82.46) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 22 Feb 2011 08:34:40 +0000 Received: by wwj40 with SMTP id 40so6870006wwj.15 for ; Tue, 22 Feb 2011 00:34:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=9RwcmdhWfh0PWVeh1Y0CU2O2c9pcul35QzXczuwLnDM=; b=UGu/v3udOFl/99g/DbaDZgV5jUGb1K58GytX7tHSVOpn6kZxQyd6jyq2TOVz26f4Gw n2l5chBL9HD+98LGuCSaMYMaQItJr0yHZLKBFy7x58Pz5kFVxjAYkhMrg5lIR9o1SNTY J+SUHs2s6NunzrwUWQPL/hyDf/YnAfInYNP90= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=kB23gilRvfnLF0cb8jB1km/YkAABjzDpRLFepNXXBPjuNmPtiYpEzm0fiFI+errY7U sEumHkacoCm9ew9g68HJDN0+Y2nf+FePmlGisryIBvd8n/BfutHO3E6fl8y8OL+yiDc5 aHLwEMRyJQBeGEb/1IlzLcjDbuKqsTsFwrpsw= MIME-Version: 1.0 Received: by 10.227.135.135 with SMTP id n7mr2054946wbt.185.1298363659455; Tue, 22 Feb 2011 00:34:19 -0800 (PST) Received: by 10.227.41.205 with HTTP; Tue, 22 Feb 2011 00:34:19 -0800 (PST) In-Reply-To: References: Date: Tue, 22 Feb 2011 09:34:19 +0100 Message-ID: Subject: Re: Problems with ACL From: Ride Shoot Speak To: user@zookeeper.apache.org Content-Type: multipart/alternative; boundary=001636416375b60c04049cdad84a --001636416375b60c04049cdad84a Content-Type: text/plain; charset=ISO-8859-1 2011/2/15 Michi Mutsuzaki > On 2/15/11 1:40 AM, "Ride Shoot Speak" > wrote: > > Hi, > > > > I want to use ZOO_CREATOR_ALL_ACL for the creation of all znodes. > > Unfortunately zoo_create always returns ZINVALIDACL (-114) each time I > try > > to zoo_create a znode. Everything works fine using ZOO_OPEN_ACL_UNSAFE. I > > use digest authentication. Any ideas? > > > > TIA > > Jan > > Hi Jan, > > Could you post a code snippet that shows how you are calling zoo_create()? > Have you called zoo_add_auth()? > > Thanks! > --Michi > > Hi Michi, sorry for answering a bit late. Yes I've calle zoo_add_auth(). I've wrapped the C API into a simple class. The methods of interest are these I guess: void ZooKeeper::connect(const std::string & hosts, unsigned int timeout) { disconnect(); zhandle_ = zookeeper_init(hosts.c_str(), connectionWatcher, timeout, 0, this, 0); if (zhandle_ == 0) { throw ZooKeeperException(errno, zerror(errno)); } } void ZooKeeper::authenticate(const std::string & user, const std::string & password) { const std::string digest = user + ":" + password; const int errorCode = zoo_add_auth(zhandle_, "digest", digest.c_str(), digest.length(), 0, 0); if (errorCode != ZOK) { throw ZooKeeperException(errorCode, zerror(errorCode)); } } I call connect and then authenticate. Right now there is only one pair of credentials so all modules using the wrapper use the same user to access the ZK. Best regards Jan --001636416375b60c04049cdad84a--