Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-11392

FSPermissionChecker#checkSubAccess should support inodeattribute provider

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.7.0
    • None
    • namenode
    • None

    Description

      HDFS-6826 added this TODO in FSPermissionChecker#checkSubAccess:

      FSPermissionChecker#checkSubAccess
              //TODO have to figure this out with inodeattribute provider
              INodeAttributes inodeAttr =
                  getINodeAttrs(components, pathIdx, d, snapshotId);
      

      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 .

      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;
        }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              jzhuge John Zhuge
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: