Details
Description
When INodeAttributesProvider is configured, and when resolving path (like "/") and checking for permission, the following code when working on pathByNameArr throws NullPointerException.
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; }
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.
Attachments
Attachments
Issue Links
- duplicates
-
HDFS-15226 Ranger integrates HDFS and discovers NPE
- Resolved
- fixes
-
RANGER-2745 execute hdfs dfs -ls / NPE
- Closed
- relates to
-
HDFS-10673 Optimize FSPermissionChecker's internal path usage
- Resolved