From commits-return-22958-archive-asf-public=cust-asf.ponee.io@accumulo.apache.org Fri Jun 7 16:40:13 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id A1963180763 for ; Fri, 7 Jun 2019 18:40:12 +0200 (CEST) Received: (qmail 23793 invoked by uid 500); 7 Jun 2019 16:40:12 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 23779 invoked by uid 99); 7 Jun 2019 16:40:12 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Jun 2019 16:40:12 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id C4D2687A69; Fri, 7 Jun 2019 16:40:11 +0000 (UTC) Date: Fri, 07 Jun 2019 16:40:11 +0000 To: "commits@accumulo.apache.org" Subject: [accumulo] branch 1.9 updated: Ensures correct use of ZooKeeper getAcl (#1185) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <155992561168.19707.10668410531036775516@gitbox.apache.org> From: ctubbsii@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: accumulo X-Git-Refname: refs/heads/1.9 X-Git-Reftype: branch X-Git-Oldrev: 057f14e23764bc72d0a3e3a85de03632e3b45b0a X-Git-Newrev: 3311218c639173f1df41fa31b318e17a1e0ce47f X-Git-Rev: 3311218c639173f1df41fa31b318e17a1e0ce47f X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. ctubbsii pushed a commit to branch 1.9 in repository https://gitbox.apache.org/repos/asf/accumulo.git The following commit(s) were added to refs/heads/1.9 by this push: new 3311218 Ensures correct use of ZooKeeper getAcl (#1185) 3311218 is described below commit 3311218c639173f1df41fa31b318e17a1e0ce47f Author: Christopher Tubbs AuthorDate: Fri Jun 7 12:40:06 2019 -0400 Ensures correct use of ZooKeeper getAcl (#1185) This fixes a bug in Accumulo where we were using an unauthenticated ZooKeeper session to read ACLs on a node that we had previously written. ZooKeeper 3.4.14 fixed a bug in their code that allowed unauthenticated connections to read ACLs on paths for which they did not have READ permission. Using Accumulo with that version of ZooKeeper exposed the bug in our code that passed the incorrect ZooKeeper session when retrieving ACLs. --- fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReader.java | 5 +---- fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java | 4 ++-- pom.xml | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReader.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReader.java index 3bd470f..24a2bc8 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReader.java +++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooReader.java @@ -22,7 +22,6 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.accumulo.fate.util.Retry; import org.apache.accumulo.fate.util.Retry.RetryFactory; -import org.apache.accumulo.fate.zookeeper.ZooUtil.ZooKeeperConnectionInfo; import org.apache.zookeeper.AsyncCallback.VoidCallback; import org.apache.zookeeper.KeeperException; import org.apache.zookeeper.KeeperException.Code; @@ -39,7 +38,6 @@ public class ZooReader implements IZooReader { protected String keepers; protected int timeout; private final RetryFactory retryFactory; - private final ZooKeeperConnectionInfo info; protected ZooKeeper getSession(String keepers, int timeout, String scheme, byte[] auth) { return ZooSession.getSession(keepers, timeout, scheme, auth); @@ -255,13 +253,12 @@ public class ZooReader implements IZooReader { @Override public List getACL(String zPath, Stat stat) throws KeeperException, InterruptedException { - return ZooUtil.getACL(info, zPath, stat); + return ZooUtil.getACL(getZooKeeper(), zPath, stat); } public ZooReader(String keepers, int timeout) { this.keepers = keepers; this.timeout = timeout; this.retryFactory = ZooUtil.DEFAULT_RETRY; - this.info = new ZooKeeperConnectionInfo(keepers, timeout, null, null); } } diff --git a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java index bbd4611..a61d668 100644 --- a/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java +++ b/fate/src/main/java/org/apache/accumulo/fate/zookeeper/ZooUtil.java @@ -545,12 +545,12 @@ public class ZooUtil { } } - public static List getACL(ZooKeeperConnectionInfo info, String zPath, Stat stat) + public static List getACL(ZooKeeper zk, String zPath, Stat stat) throws KeeperException, InterruptedException { final Retry retry = RETRY_FACTORY.createRetry(); while (true) { try { - return getZooKeeper(info).getACL(zPath, stat); + return zk.getACL(zPath, stat); } catch (KeeperException e) { final Code c = e.code(); if (c == Code.CONNECTIONLOSS || c == Code.OPERATIONTIMEOUT || c == Code.SESSIONEXPIRED) { diff --git a/pom.xml b/pom.xml index 1ef5233..e5f2e2b 100644 --- a/pom.xml +++ b/pom.xml @@ -149,7 +149,7 @@ 0.9.3-1 - 3.4.6 + 3.4.14