Skip to content
Snippets Groups Projects
Commit 18665865 authored by Patrick Dowler's avatar Patrick Dowler
Browse files

changed internal getGroup to use search instead of searchEntry

parent ad4fc1e6
No related branches found
No related tags found
No related merge requests found
...@@ -1022,8 +1022,7 @@ public class LdapGroupDAO<T extends Principal> extends LdapDAO ...@@ -1022,8 +1022,7 @@ public class LdapGroupDAO<T extends Principal> extends LdapDAO
new ProxiedAuthorizationV2RequestControl("dn:" + new ProxiedAuthorizationV2RequestControl("dn:" +
getSubjectDN().toNormalizedString())); getSubjectDN().toNormalizedString()));
SearchResultEntry result = SearchResult result = getConnection().search(searchRequest);
getConnection().searchForEntry(searchRequest);
if (result == null) if (result == null)
{ {
...@@ -1031,14 +1030,18 @@ public class LdapGroupDAO<T extends Principal> extends LdapDAO ...@@ -1031,14 +1030,18 @@ public class LdapGroupDAO<T extends Principal> extends LdapDAO
logger.debug(msg); logger.debug(msg);
throw new GroupNotFoundException(groupDN.toNormalizedString()); throw new GroupNotFoundException(groupDN.toNormalizedString());
} }
if (result.getEntryCount() == 0)
throw new GroupNotFoundException(groupDN.toString());
if (result.getAttribute("nsaccountlock") != null) SearchResultEntry sre = result.getSearchEntries().get(0);
if (sre.getAttribute("nsaccountlock") != null)
{ {
// TODO: logger.error() + throw GroupNotFoundException instead? // TODO: logger.error() + throw GroupNotFoundException instead?
throw new RuntimeException("BUG: found group with nsaccountlock set: " + groupDN.toString()); throw new RuntimeException("BUG: found group with nsaccountlock set: " + groupDN.toString());
} }
Group g = createGroup(result); Group g = createGroup(sre);
logger.debug("found: " + g.getID()); logger.debug("found: " + g.getID());
return g; return g;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment