From 3c8d3816c67d5309c56f2ee08876967e34b65ab6 Mon Sep 17 00:00:00 2001 From: "Aaron T. Myers" Date: Tue, 27 Jan 2015 13:50:45 -0800 Subject: [PATCH] HADOOP-10626. Limit Returning Attributes for LDAP search. Contributed by Jason Hubbard. (cherry picked from commit 8709751e1ee9a2c5553823dcd715bd077052ad7f) --- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../java/org/apache/hadoop/security/LdapGroupsMapping.java | 2 ++ 2 files changed, 5 insertions(+) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 43c5fc230bd..9b841ce7cb7 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -144,6 +144,9 @@ Release 2.7.0 - UNRELEASED HADOOP-4297. Enable Java assertions when running tests. (Tsz Wo Nicholas Sze via wheat9) + HADOOP-10626. Limit Returning Attributes for LDAP search. (Jason Hubbard + via atm) + OPTIMIZATIONS HADOOP-11323. WritableComparator#compare keeps reference to byte array. diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/LdapGroupsMapping.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/LdapGroupsMapping.java index c0c8d2b64f5..d463ac7a2be 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/LdapGroupsMapping.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/LdapGroupsMapping.java @@ -341,6 +341,8 @@ public class LdapGroupsMapping int dirSearchTimeout = conf.getInt(DIRECTORY_SEARCH_TIMEOUT, DIRECTORY_SEARCH_TIMEOUT_DEFAULT); SEARCH_CONTROLS.setTimeLimit(dirSearchTimeout); + // Limit the attributes returned to only those required to speed up the search. See HADOOP-10626 for more details. + SEARCH_CONTROLS.setReturningAttributes(new String[] {groupNameAttr}); this.conf = conf; }