You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Manoj Govindassamy (JIRA)" <ji...@apache.org> on 2017/10/07 01:41:00 UTC
[jira] [Created] (HDFS-12614) FSPermissionChecker#getINodeAttrs()
throws NPE when INodeAttributesProvider configured
Manoj Govindassamy created HDFS-12614:
-----------------------------------------
Summary: FSPermissionChecker#getINodeAttrs() throws NPE when INodeAttributesProvider configured
Key: HDFS-12614
URL: https://issues.apache.org/jira/browse/HDFS-12614
Project: Hadoop HDFS
Issue Type: Bug
Reporter: Manoj Govindassamy
Assignee: Manoj Govindassamy
When INodeAttributesProvider is configured, and when resolving path (like "/") and checking for permission, the following code when working on {{pathByNameArr}} throws NullPointerException.
{noformat}
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;
}
{noformat}
Looks like for paths like "/" where the split components based on delimiter "/" can be null, the pathByNameArr array can have null elements and can throw NPE.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org