Fix for SEC-512. Removed unnecessary context creation.

This commit is contained in:
Luke Taylor 2007-07-24 17:01:36 +00:00
parent aea1148ffb
commit b646a06443
2 changed files with 3 additions and 6 deletions

View File

@ -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(" ]");

View File

@ -42,7 +42,6 @@ public class FilterBasedLdapUserSearchTests extends AbstractLdapServerTestCase {
} }
public FilterBasedLdapUserSearchTests() { public FilterBasedLdapUserSearchTests() {
super();
} }
//~ Methods ======================================================================================================== //~ Methods ========================================================================================================