Uploaded image for project: 'Directory ApacheDS'
  1. Directory ApacheDS
  2. DIRSERVER-652

Avoid multiple creation of LdapDN

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-RC3
    • 1.0-RC4
    • None
    • None

    Description

      After having profiled the server, I found that the LdapDN<init>(Name) has been called 3000 times, because the LdapPrincipal contains a Name instead of a LdapDN element.

      We should check that the passed Name is not an instance of LdapDN before calling new LdapDN( Name) in
      org.apache.directory.server.core.authz.DefaultAuthorizationService.protectLookUp() method
      :
      ...
      LdapDN principalDn = new LdapDN( ( ( ServerContext ) ctx ).getPrincipal().getJndiName() );
      ...

      could be :
      Name name = ( ( ServerContext ) ctx ).getPrincipal().getJndiName() ;

      LdapDN principalDn= ( name instanceof LdapDN ? name.clone() : new LdapDN( name ) );

      Attachments

        Activity

          People

            Unassigned Unassigned
            elecharny Emmanuel Lécharny
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: