[ 
https://issues.apache.org/jira/browse/HDFS-11392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Shilun Fan updated HDFS-11392:
------------------------------
    Target Version/s: 3.5.0  (was: 3.4.0)

> 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
(v8.20.10#820010)

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

Reply via email to