[
https://issues.apache.org/jira/browse/HDFS-11764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16005227#comment-16005227
]
Chen Liang commented on HDFS-11764:
-----------------------------------
Hi [~runlinzhang], could you please elaborate a little bit about how you ran
into this? Looks like none of the subclasses of GroupMappingServiceProvider
would ever return a null for getGroups(). And from which branch were you
getting this? The line numbers in the image file do not seem to match any of
trunk, branch-2.7 or branch-2.7.2
> NPE when the GroupMappingServiceProvider has no group
> ------------------------------------------------------
>
> Key: HDFS-11764
> URL: https://issues.apache.org/jira/browse/HDFS-11764
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: security
> Affects Versions: 2.7.2
> Reporter: runlinzhang
> Priority: Critical
> Fix For: 2.7.2
>
> Attachments: image.png
>
>
> The following code can throw NPE if GroupMappingServiceProvider.getGroups()
> returns null.
> public List<String> load(String user) throws Exception {
> List<String> groups = fetchGroupList(user);
> if (groups.isEmpty()) {
> if (isNegativeCacheEnabled()) {
> negativeCache.add(user);
> }
> // We throw here to prevent Cache from retaining an empty group
> throw noGroupsForUser(user);
> }
> return groups;
> }
> eg:image
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]