John Zhuge created HDFS-11392:
---------------------------------

             Summary: FSPermissionChecker#checkSubAccess should support 
inodeattribute provider
                 Key: HDFS-11392
                 URL: https://issues.apache.org/jira/browse/HDFS-11392
             Project: Hadoop HDFS
          Issue Type: Bug
          Components: namenode
    Affects Versions: 2.7.0
            Reporter: John Zhuge
            Priority: Minor


HDFS-6826 added this TODO in {{FSPermissionChecker#checkSubAccess}}:
{code:title=FSPermissionChecker#checkSubAccess}
        //TODO have to figure this out with inodeattribute provider
        INodeAttributes inodeAttr =
            getINodeAttrs(components, pathIdx, d, snapshotId);
{code}

If inodeattribute provider in play, it always incorrectly returns the root attr 
of the subtree even when it descends multiple levels down the sub tree, because 
the components array is for the root .

{code:title=FSPermissionChecker#getINodeAttrs}
  private INodeAttributes getINodeAttrs(byte[][] pathByNameArr, int pathIdx,
      INode inode, int snapshotId) {
    INodeAttributes inodeAttrs = inode.getSnapshotINode(snapshotId);
    if (getAttributesProvider() != null) {
      String[] elements = new String[pathIdx + 1];
      for (int i = 0; i < elements.length; i++) {
        elements[i] = DFSUtil.bytes2String(pathByNameArr[i]);
      }
      inodeAttrs = getAttributesProvider().getAttributes(elements, inodeAttrs);
    }
    return inodeAttrs;
  }
{code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org

Reply via email to