You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "Shilun Fan (Jira)" <ji...@apache.org> on 2024/01/04 07:44:00 UTC

[jira] [Updated] (HDFS-11392) FSPermissionChecker#checkSubAccess should support inodeattribute provider

     [ 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-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org