Skip to content

Commit

Permalink
Fix searching on domain root
Browse files Browse the repository at this point in the history
  • Loading branch information
sagneessens committed Feb 23, 2023
1 parent 891c3b0 commit 2021d31
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<groupId>org.wso2.carbon.connector</groupId>
<artifactId>org.wso2.carbon.connector.ldap</artifactId>
<packaging>jar</packaging>
<version>1.0.12-bdod-v4</version>
<version>1.0.12-bdod-v5</version>
<name>WSO2 Carbon - Mediation Library Connector For LDAP</name>
<url>http://wso2.org</url>
<properties>
Expand Down
11 changes: 11 additions & 0 deletions src/main/java/org/wso2/carbon/connector/ldap/SearchEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
import javax.naming.PartialResultException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
Expand Down Expand Up @@ -115,6 +116,16 @@ public void connect(MessageContext messageContext) {
if (context != null) {
context.close();
}
} catch (PartialResultException e) {
if (!dn.contains("OU=")) {
LDAPUtils.preparePayload(messageContext, result);
if (context != null) {
context.close();
}
} else {
LDAPUtils.handleErrorResponse(messageContext, LDAPConstants.ErrorConstants.SEARCH_ERROR, e);
throw new SynapseException(e);
}
} catch (NamingException e) { // LDAP Errors are catched
LDAPUtils.handleErrorResponse(messageContext, LDAPConstants.ErrorConstants.SEARCH_ERROR, e);
throw new SynapseException(e);
Expand Down

0 comments on commit 2021d31

Please sign in to comment.