Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2476

Special characters are dropped when generating the LDAP the user and role filters

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.4.0, 3.0.0, 2.3.4
    • Component/s: None
    • Labels:
      None

      Description

      The current code - org.apache.karaf.jaas.modules.ldap.LDAPLoginModule - forms the userFilter and roleFilter:
      logger.debug("Looking for the user in LDAP with ");
      logger.debug(" base DN: " + userBaseDN);
      userFilter = userFilter.replaceAll("%u", user);

      logger.debug("Looking for the user roles in LDAP with ");
      logger.debug(" base DN: " + roleBaseDN);
      roleFilter = roleFilter.replaceAll("%u", user);
      roleFilter = roleFilter.replaceAll("%dn", userDN);

      the "replaceAll" method is a regular expression replacement that interprets special characters. LDAP user names and DN can contain special characters and we do not want to process them. The filters should be formed as "quotes" - uninterpreted strings.

        Attachments

          Activity

            People

            • Assignee:
              ffang Freeman Fang
              Reporter:
              janstey Jonathan Anstey
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: