Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1FA55118AD for ; Wed, 20 Aug 2014 15:30:04 +0000 (UTC) Received: (qmail 71050 invoked by uid 500); 20 Aug 2014 15:30:03 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 70886 invoked by uid 500); 20 Aug 2014 15:30:03 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 70453 invoked by uid 99); 20 Aug 2014 15:30:03 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Aug 2014 15:30:03 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 118EA9547FC; Wed, 20 Aug 2014 15:30:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jonathanhurley@apache.org To: commits@ambari.apache.org Date: Wed, 20 Aug 2014 15:30:12 -0000 Message-Id: <5ab0aa555d954d5da64c7ca11b3aba08@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [11/50] [abbrv] 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/bba2806f Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/bba2806f Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/bba2806f Branch: refs/heads/branch-alerts-dev Commit: bba2806f76d98a139e83736fd08b72fae0ab27c1 Parents: e7d864c Author: Mahadev Konar Authored: Mon Aug 18 13:29:51 2014 -0700 Committer: Mahadev Konar Committed: Mon Aug 18 13:29:55 2014 -0700 ---------------------------------------------------------------------- .../authorization/AmbariLdapDataPopulator.java | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/bba2806f/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) {