[
https://issues.apache.org/jira/browse/HADOOP-12468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14972099#comment-14972099
]
Benoy Antony commented on HADOOP-12468:
---------------------------------------
We have faced this issue a few time on our cluster. The user was blocked and we
have to fix the issue on a high priority. But in a healthy system , this issue
should not occur.
I have the following comments on this patch.
1. The implementation makes an assumption that the groupname cannot be
numeric. While a groupname consisting solely of digits is bad idea, systems
allows groupnames consisting solely of digits. So the following check is not a
good one. We need a better check to determine whether a group is unresolvable
than isNumeric.
{code}
if (!groupName.isEmpty() && !StringUtils.isNumeric(groupName)) {
groups.add(groupName);
}
{code}
2. Unnecessary modification. I believe the reason to have run "id -gn" is to
keep primary group name as the first entry.
{code}
: new String [] {"bash", "-c", "id -gn " + user + "&& id -Gn " + user};
: new String [] {"bash", "-c", "id -Gn " + user};
{code}
3. Logging groupnames is not a good idea as the groupnames for some users could
be a very long list.
4.String errMeessage = e.getMessage();
There is a typo in variable name.
This variable is not used anywhere. But I believe the error message should be
logged.
> Partial group resolution failure should not result in user lockout
> ------------------------------------------------------------------
>
> Key: HADOOP-12468
> URL: https://issues.apache.org/jira/browse/HADOOP-12468
> Project: Hadoop Common
> Issue Type: Bug
> Components: security
> Affects Versions: 2.6.1
> Environment: Linux
> Reporter: Wei-Chiu Chuang
> Assignee: Wei-Chiu Chuang
> Priority: Minor
> Attachments: HADOOP-12468.001.patch, HADOOP-12468.002.patch,
> HADOOP-12468.003.patch
>
>
> If a Hadoop cluster is configured to use ShellBasedUnixGroupsMapping for
> user/group name mapping, occasionally some group names may become
> unresolvable (for example, using SSSD).
> ShellBasedUnixGroupsMapping uses shell command "id -Gn" to retrieve the group
> name of a user; however, the existing logic assumes that if the exit code of
> the command is non-zero, the user has no group name at all. The shell command
> in Linux returns non-zero exit code if a group name is not resolvable.
> Unfortunately, it is possible that a user belongs to multiple groups, and any
> partial failure in group name resolution would denied the user's access.
> On the other hand, the JNI implementation (JniBasedUnixGroupsMapping) is more
> resilient. If any group name is unresolvable, it is simply ignored, and
> whatever are resolvable are returned.
> It is arguable that if the group name is not resolvable, the administrator
> should configure their directory/authentication service correctly, and Hadoop
> is in no position to handle it, but since the existing unit tests assume the
> output of JNI-based and shell-based implementation are the same, we should
> improve the shell-based group name resolution, and make it as resilient as
> the JNI-based one.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)