Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 28F11200B64 for ; Tue, 2 Aug 2016 20:32:27 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 27C52160A76; Tue, 2 Aug 2016 18:32:27 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 48BDE160A65 for ; Tue, 2 Aug 2016 20:32:26 +0200 (CEST) Received: (qmail 47698 invoked by uid 500); 2 Aug 2016 18:32:25 -0000 Mailing-List: contact commits-help@manifoldcf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@manifoldcf.apache.org Delivered-To: mailing list commits@manifoldcf.apache.org Received: (qmail 47689 invoked by uid 99); 2 Aug 2016 18:32:25 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2016 18:32:25 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id EB45818588D for ; Tue, 2 Aug 2016 18:32:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.374 X-Spam-Level: X-Spam-Status: No, score=0.374 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id w_06YOVvtOGk for ; Tue, 2 Aug 2016 18:32:23 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTP id BEFFF5F233 for ; Tue, 2 Aug 2016 18:32:22 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id CFB94E0425 for ; Tue, 2 Aug 2016 18:32:21 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id E85813A0562 for ; Tue, 2 Aug 2016 18:32:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1754985 - in /manifoldcf/trunk: CHANGES.txt connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java Date: Tue, 02 Aug 2016 18:32:20 -0000 To: commits@manifoldcf.apache.org From: kwright@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160802183220.E85813A0562@svn01-us-west.apache.org> archived-at: Tue, 02 Aug 2016 18:32:27 -0000 Author: kwright Date: Tue Aug 2 18:32:20 2016 New Revision: 1754985 URL: http://svn.apache.org/viewvc?rev=1754985&view=rev Log: Fix for CONNECTORS-1329. Committed on behalf of Furkan KAMACI. Modified: manifoldcf/trunk/CHANGES.txt manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java Modified: manifoldcf/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1754985&r1=1754984&r2=1754985&view=diff ============================================================================== --- manifoldcf/trunk/CHANGES.txt (original) +++ manifoldcf/trunk/CHANGES.txt Tue Aug 2 18:32:20 2016 @@ -3,6 +3,9 @@ $Id$ ======================= 2.5-dev ===================== +CONNECTORS-1329: Add logging to LDAP connector. +(Furkan KAMACI) + CONNECTORS-1326: Fix URL for Confluence documents. (Chalitha Perera) Modified: manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java?rev=1754985&r1=1754984&r2=1754985&view=diff ============================================================================== --- manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java (original) +++ manifoldcf/trunk/connectors/ldap/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/ldap/LDAPAuthority.java Tue Aug 2 18:32:20 2016 @@ -151,30 +151,39 @@ public class LDAPAuthority extends org.a try { if (session == null) { if (serverName == null || serverName.length() == 0) { + Logging.authorityConnectors.error("Server name parameter missing but required"); throw new ManifoldCFException("Server name parameter missing but required"); } if (serverPort == null || serverPort.length() == 0) { + Logging.authorityConnectors.error("Server port parameter missing but required"); throw new ManifoldCFException("Server port parameter missing but required"); } if (serverBase == null) { + Logging.authorityConnectors.error("Server base parameter missing but required"); throw new ManifoldCFException("Server base parameter missing but required"); } if (userBase == null) { + Logging.authorityConnectors.error("User base parameter missing but required"); throw new ManifoldCFException("User base parameter missing but required"); } if (userSearch == null || userSearch.length() == 0) { + Logging.authorityConnectors.error("User search expression missing but required"); throw new ManifoldCFException("User search expression missing but required"); } if (groupBase == null) { + Logging.authorityConnectors.error("Group base parameter missing but required"); throw new ManifoldCFException("Group base parameter missing but required"); } if (groupSearch == null || groupSearch.length() == 0) { + Logging.authorityConnectors.error("Group search expression missing but required"); throw new ManifoldCFException("Group search expression missing but required"); } if (groupNameAttr == null || groupNameAttr.length() == 0) { + Logging.authorityConnectors.error("Group name attribute missing but required"); throw new ManifoldCFException("Group name attribute missing but required"); } if (userNameAttr == null || userNameAttr.length() == 0) { + Logging.authorityConnectors.error("User name attribute missing but required"); throw new ManifoldCFException("User name attribute missing but required"); } @@ -217,6 +226,7 @@ public class LDAPAuthority extends org.a env.put(Context.SECURITY_CREDENTIALS, bindPass); } + Logging.authorityConnectors.info("LDAP Context environment properties: " + Arrays.toString(env.entrySet().toArray())); session = new InitialLdapContext(env, null); if (useTls) { @@ -235,22 +245,27 @@ public class LDAPAuthority extends org.a } catch (AuthenticationException e) { session = null; sessionExpirationTime = -1L; + Logging.authorityConnectors.error("Authentication error: " + e.getMessage() + ", explanation: " + e.getExplanation(), e); throw new ManifoldCFException("Authentication error: " + e.getMessage() + ", explanation: " + e.getExplanation(), e); } catch (CommunicationException e) { session = null; sessionExpirationTime = -1L; + Logging.authorityConnectors.error("Communication error: " + e.getMessage(), e); throw new ManifoldCFException("Communication error: " + e.getMessage(), e); } catch (NamingException e) { session = null; sessionExpirationTime = -1L; + Logging.authorityConnectors.error("Naming error: " + e.getMessage(), e); throw new ManifoldCFException("Naming error: " + e.getMessage(), e); } catch (InterruptedIOException e) { session = null; sessionExpirationTime = -1L; + Logging.authorityConnectors.error("Interrupted IO error: " + e.getMessage()); throw new ManifoldCFException(e.getMessage(), ManifoldCFException.INTERRUPTED); } catch (IOException e) { session = null; sessionExpirationTime = -1L; + Logging.authorityConnectors.error("IO error: " + e.getMessage(), e); throw new ManifoldCFException("IO error: " + e.getMessage(), e); } } @@ -453,6 +468,7 @@ public class LDAPAuthority extends org.a } catch (NameNotFoundException e) { // This means that the user doesn't exist + Logging.authorityConnectors.error("Response Unreachable: "+e.getMessage(),e); return RESPONSE_USERNOTFOUND; } catch (NamingException e) { // Unreachable @@ -787,11 +803,9 @@ public class LDAPAuthority extends org.a * * @param ctx is the ldap context to use. * @param userName (Domain Logon Name) is the user name or identifier. - * @param searchBase (Full Domain Name for the search ie: * DC=qa-ad-76,DC=metacarta,DC=com) * @return SearchResult for given domain user logon name. (Should throws an - * exception if user is not found.) - */ + * exception if user is not found.) */ protected SearchResult getUserEntry(LdapContext ctx, String userName) throws ManifoldCFException { String searchFilter = userSearch.replaceAll("\\{0\\}", escapeDN(userName.split("@")[0]));