You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2014/08/19 05:40:00 UTC

[07/12] git commit: AMBARI-6902. LDAP uses redundant properties from ambari configuration. (mahadev)

AMBARI-6902. LDAP uses redundant properties from ambari configuration. (mahadev)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/7097e82e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/7097e82e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/7097e82e

Branch: refs/heads/branch-alerts-dev
Commit: 7097e82e2db4a239e31681ee3188f92bebb199d7
Parents: 5af89a5
Author: Mahadev Konar <ma...@apache.org>
Authored: Mon Aug 18 13:29:51 2014 -0700
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Mon Aug 18 23:12:35 2014 -0400

----------------------------------------------------------------------
 .../authorization/AmbariLdapDataPopulator.java     | 17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7097e82e/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapDataPopulator.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapDataPopulator.java b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapDataPopulator.java
index 29b69a6..7932833 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapDataPopulator.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/security/authorization/AmbariLdapDataPopulator.java
@@ -91,7 +91,7 @@ public class AmbariLdapDataPopulator {
 
             public Object mapFromAttributes(Attributes attributes)
                 throws NamingException {
-              return attributes.get("uid").get();
+              return "";
             }
           });
       return true;
@@ -269,10 +269,7 @@ public class AmbariLdapDataPopulator {
     final LdapTemplate ldapTemplate = loadLdapTemplate();
     final EqualsFilter equalsFilter = new EqualsFilter("objectClass",
         ldapServerProperties.getGroupObjectClass());
-    String baseDn = ldapServerProperties.getGroupBase();
-    if (baseDn == null) {
-      baseDn = ldapServerProperties.getBaseDN();
-    }
+    String baseDn = ldapServerProperties.getBaseDN();
     ldapTemplate.search(baseDn, equalsFilter.encode(), new AttributesMapper() {
 
       public Object mapFromAttributes(Attributes attributes)
@@ -295,10 +292,7 @@ public class AmbariLdapDataPopulator {
     final LdapTemplate ldapTemplate = loadLdapTemplate();
     final EqualsFilter equalsFilter = new EqualsFilter("objectClass",
         ldapServerProperties.getUserObjectClass());
-    String baseDn = ldapServerProperties.getUserBase();
-    if (baseDn == null) {
-      baseDn = ldapServerProperties.getBaseDN();
-    }
+    String baseDn = ldapServerProperties.getBaseDN();
     ldapTemplate.search(baseDn, equalsFilter.encode(), new AttributesMapper() {
 
       public Object mapFromAttributes(Attributes attributes)
@@ -323,10 +317,7 @@ public class AmbariLdapDataPopulator {
     final AndFilter andFilter = new AndFilter();
     andFilter.and(new EqualsFilter("objectClass", ldapServerProperties.getGroupObjectClass()));
     andFilter.and(new EqualsFilter(ldapServerProperties.getGroupNamingAttr(), groupName));
-    String baseDn = ldapServerProperties.getGroupBase();
-    if (baseDn == null) {
-      baseDn = ldapServerProperties.getBaseDN();
-    }
+    String baseDn = ldapServerProperties.getBaseDN();
     ldapTemplate.search(baseDn, andFilter.encode(), new ContextMapper() {
 
       public Object mapFromContext(Object ctx) {