Fix for SEC-512. Removed unnecessary context creation.
This commit is contained in:
parent
aea1148ffb
commit
b646a06443
|
@ -106,10 +106,8 @@ public class FilterBasedLdapUserSearch implements LdapUserSearch {
|
||||||
* @throws UsernameNotFoundException if no matching entry is found.
|
* @throws UsernameNotFoundException if no matching entry is found.
|
||||||
*/
|
*/
|
||||||
public LdapUserDetails searchForUser(String username) {
|
public LdapUserDetails searchForUser(String username) {
|
||||||
DirContext ctx = initialDirContextFactory.newInitialDirContext();
|
|
||||||
|
|
||||||
if (logger.isDebugEnabled()) {
|
if (logger.isDebugEnabled()) {
|
||||||
logger.debug("Searching for user '" + username + "', in context " + ctx + ", with user search "
|
logger.debug("Searching for user '" + username + "', with user search "
|
||||||
+ this.toString());
|
+ this.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -167,7 +165,7 @@ public class FilterBasedLdapUserSearch implements LdapUserSearch {
|
||||||
sb.append("[ searchFilter: '").append(searchFilter).append("', ");
|
sb.append("[ searchFilter: '").append(searchFilter).append("', ");
|
||||||
sb.append("searchBase: '").append(searchBase).append("'");
|
sb.append("searchBase: '").append(searchBase).append("'");
|
||||||
sb.append(", scope: ")
|
sb.append(", scope: ")
|
||||||
.append((searchControls.getSearchScope() == SearchControls.SUBTREE_SCOPE) ? "subtree" : "single-level, ");
|
.append(searchControls.getSearchScope() == SearchControls.SUBTREE_SCOPE ? "subtree" : "single-level, ");
|
||||||
sb.append("searchTimeLimit: ").append(searchControls.getTimeLimit());
|
sb.append("searchTimeLimit: ").append(searchControls.getTimeLimit());
|
||||||
sb.append("derefLinkFlag: ").append(searchControls.getDerefLinkFlag()).append(" ]");
|
sb.append("derefLinkFlag: ").append(searchControls.getDerefLinkFlag()).append(" ]");
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ public class FilterBasedLdapUserSearchTests extends AbstractLdapServerTestCase {
|
||||||
}
|
}
|
||||||
|
|
||||||
public FilterBasedLdapUserSearchTests() {
|
public FilterBasedLdapUserSearchTests() {
|
||||||
super();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//~ Methods ========================================================================================================
|
//~ Methods ========================================================================================================
|
||||||
|
|
Loading…
Reference in New Issue