Spring Security
  1. Spring Security
  2. SEC-1520

Enumerator not closed or fully-enumerated

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.5, 3.0.3
    • Fix Version/s: 3.1.0.M1, 3.0.4
    • Component/s: None
    • Labels:
      None

      Description

      1- SpringSecurityLdapTemplate.java, in compare (called by the LDAP password authenticator)

      NamingEnumeration<SearchResult> results = ctx.search(dn, comparisonFilter, new Object[]

      {value}, ctls);
      return Boolean.valueOf(results.hasMore());

      should be more like this
      NamingEnumeration<SearchResult> results = ctx.search(dn, comparisonFilter, new Object[] {value}

      , ctls);
      boolean rtn = Boolean.valueOf(results.hasMore());
      try {
      results.close();
      } catch (NamingException ignored) {
      // Ignore naming exception on close.
      }
      return rtn;

      2- DefaultDirContextValidator.validateDirContext has a similar problem, but I think that class has been refactored or eliminated.

        Activity

        Hide
        Luke Taylor added a comment -

        Thanks, this should be fixed now. NamingEnumerations should be closed automtically when garbage collected, but it should certainly be more efficient to close them as early as possible.

        Show
        Luke Taylor added a comment - Thanks, this should be fixed now. NamingEnumerations should be closed automtically when garbage collected, but it should certainly be more efficient to close them as early as possible.

          People

          • Assignee:
            Luke Taylor
            Reporter:
            Marc Batchelor
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: