-
Notifications
You must be signed in to change notification settings - Fork 9.1k
HADOOP-18074 - Partial/Incomplete groups list can be returned in LDAP… #4503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
production code looks good, commented on the tests with my main concern being "mockito test maintenance is painful, so we should help whoever has to do it as much as we can" +1 pending those changes for merging into trunk/branch-3.3, to see if any surprises happen this week. i will merge it in to the 3.3.4 release next week |
groupsMapping.setConf(conf); | ||
// Username is arbitrary, since the spy is mocked to respond the same, | ||
// regardless of input | ||
List<String> groups = groupsMapping.getGroups("some_user"); | ||
|
||
Assert.assertEquals(expectedGroups, groups); | ||
Assert.assertFalse(groupsMapping.isSecondaryQueryCalled()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add an error message for the assertion failure
|
||
// expect secondary query to be called: getGroups() | ||
Assert.assertTrue(groupsMapping.isSecondaryQueryCalled()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add an error message
...common-project/hadoop-common/src/main/java/org/apache/hadoop/security/LdapGroupsMapping.java
Show resolved
Hide resolved
...adoop-common/src/test/java/org/apache/hadoop/security/TestLdapGroupsMappingWithOneQuery.java
Show resolved
Hide resolved
} | ||
|
||
class TestLdapGroupsMapping extends LdapGroupsMapping { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit private final. probably static too, right
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
apache#4503) Partial/Incomplete groups list can be returned in LDAP groups lookup. Backported in apache#4550; minor tuning of parameters needed. Contributed by larry mccay Change-Id: I9a9571239ac533680a08de650f84e431e9022c79
apache#4503) * HADOOP-18074 - Partial/Incomplete groups list can be returned in LDAP groups lookup
… groups lookup
Description of PR
LdapGroupsMapping could return a partial list of group names due to encountering a NamingException while acquiring
the RDN for a DN. This was due to not clearing the partially built list which results in the secondary query not being
attempted. This PR clears the partially built list and forces the secondary query to be called.
How was this patch tested?
Existing unit tests were run and a new unit test added to insure that the secondary query is indeed being called.
For code changes:
LICENSE
,LICENSE-binary
,NOTICE-binary
files?