Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-14632

NPE when JLDAP provider gets attribute which wasn't requested

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.3
    • Fix Version/s: 2.5.6, 2.6.0, 2.7.0
    • Component/s: Providers
    • Labels:
      None

      Description

      Stack trace is:

      @4000000048ef26ed346bd684 caused by: java.lang.NullPointerException
      @4000000048ef26ed346bde54 at edu.amc.sakai.user.SimpleLdapAttributeMapper.mapLdapAttributeOntoUserData(SimpleLdapAttributeMapper.java:226)
      @4000000048ef26ed346bea0c at edu.amc.sakai.user.SimpleLdapAttributeMapper.mapLdapEntryOntoUserData(SimpleLdapAttributeMapper.java:169)
      @4000000048ef26ed346bf1dc at edu.amc.sakai.user.JLDAPDirectoryProvider.mapLdapEntryOntoUserData(JLDAPDirectoryProvider.java:927)
      @4000000048ef26ed346c0564 at edu.amc.sakai.user.JLDAPDirectoryProvider$1.mapLdapEntry(JLDAPDirectoryProvider.java:173)
      @4000000048ef26ed346c111c at edu.amc.sakai.user.JLDAPDirectoryProvider.searchDirectory(JLDAPDirectoryProvider.java:837)
      @4000000048ef26ed346c1cd4 at edu.amc.sakai.user.JLDAPDirectoryProvider.searchDirectoryForSingleEntry(JLDAPDirectoryProvider.java:741)
      @4000000048ef26ed346c305c at edu.amc.sakai.user.JLDAPDirectoryProvider.getUserByEid(JLDAPDirectoryProvider.java:679)
      @4000000048ef26ed346c382c at edu.amc.sakai.user.JLDAPDirectoryProvider.getUserByEid(JLDAPDirectoryProvider.java:640)
      @4000000048ef26ed346c3ffc at edu.amc.sakai.user.JLDAPDirectoryProvider.getUser(JLDAPDirectoryProvider.java:499)
      @4000000048ef26ed346c4bb4 at org.sakaiproject.user.impl.BaseUserDirectoryService.getProvidedUserByEid(BaseUserDirectoryService.java:604)

      This seems to be caused when the LDAP server returns attributes that weren't asked for in the original request, here is an example from our LDAP:

      buckett@macbook:~$ ldapsearch mail=matthew.buckett@oucs.ox.ac.uk oakPrincipal
      SASL/GSSAPI authentication started
      SASL username: buckett/itss@OX.AC.UK
      SASL SSF: 56
      SASL installing layers

      1. extended LDIF
        #
      2. LDAPv3
      3. base <> with scope subtree
      4. filter: mail=matthew.buckett@oucs.ox.ac.uk
      5. requesting: oakPrincipal
        #
      1. 21096, people, oak.ox.ac.uk
        dn: oakPrimaryPersonID=21096,ou=people,dc=oak,dc=ox,dc=ac,dc=uk
        oakPrincipal: krbPrincipalName=buckett@OX.AC.UK,cn=OX.AC.UK,cn=KerberosRealms,
        dc=oak,dc=ox,dc=ac,dc=uk
        oakPrincipal: krbPrincipalName=jira@OX.AC.UK,cn=OX.AC.UK,cn=KerberosRealms,dc=
        oak,dc=ox,dc=ac,dc=uk
        oakPrimaryPrincipal: krbPrincipalName=buckett@OX.AC.UK,cn=OX.AC.UK,cn=Kerberos
        Realms,dc=oak,dc=ox,dc=ac,dc=uk
      1. search result
        search: 5
        result: 0 Success
      1. numResponses: 2
      2. numEntries: 1

      I request just oakPrincipal but got oakPrincipal and oakPrimaryPrincipal.

        Gliffy Diagrams

          Zeplin

            Attachments

              Activity

                People

                Assignee:
                buckett Matthew Buckett
                Reporter:
                buckett Matthew Buckett
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Git Integration