Github user breed commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/96#discussion_r86679034
  
    --- Diff: src/java/main/org/apache/zookeeper/server/DataTree.java ---
    @@ -245,15 +245,25 @@ public DataTree() {
             addConfigNode();
         }
     
    -     public void addConfigNode() {
    -            DataNode zookeeperZnode = nodes.get(procZookeeper);
    -         if (zookeeperZnode!=null) { // should always be the case
    -            zookeeperZnode.addChild(configChildZookeeper);
    -         } else {
    -            LOG.error("There's no /zookeeper znode - this should never 
happen");
    -         }
    -         nodes.put(configZookeeper, configDataNode);   
    -     }
    +    public void addConfigNode() {
    +        DataNode zookeeperZnode = nodes.get(procZookeeper);
    +        if (zookeeperZnode!=null) { // should always be the case
    +            zookeeperZnode.addChild(configChildZookeeper);
    +        } else {
    +            LOG.error("There's no /zookeeper znode - this should never 
happen.");
    +        }
    +
    +        nodes.put(configZookeeper, configDataNode);
    +        try {
    +            // Reconfig node is access controlled by default 
(ZOOKEEPER-2014).
    +            setACL(configZookeeper, ZooDefs.Ids.READ_ACL_UNSAFE, -1);
    +        } catch (KeeperException.NoNodeException e) {
    +            LOG.error("Fail to set ACL on {} - this should never happen: 
{}", configZookeeper, e);
    --- End diff --
    
    actually if we are asserting above, perhaps we should also assert here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to