Uploaded image for project: 'OpenDJ'
  1. OpenDJ
  2. OPENDJ-7406

NPE when GSSAPISASLMechanismHandler is initialized

    Details

    • Story Points:
      0.5

      Description

      When starting the server with a configured GSSAPISASLMechanismHandler, the handler initialization will fail with a NPE:

       msg=An error occurred while trying to initialize an instance of class org.opends.server.extensions.GSSAPISASLMechanismHandler as a SASL mechanism handler as defined in configuration entry cn=GSSAPI,cn=SASL Mechanisms,cn=config: NullPointerException (GSSAPISASLMechanismHandler.java:425 GSSAPISASLMechanismHandler.java:119 GSSAPISASLMechanismHandler.java:82 SASLConfigManager.java:207 SASLConfigManager.java:88 DirectoryServer.java:1710 DirectoryServer.java:1515 StartDs.java:329 DirectoryServer.java:3599)
       

      This is because org.opends.server.extensions.GSSAPISASLMechanismHandler#initialize uses the field configuration before the field is set.

      This bug makes it impossible to use the GSSAPI SASL mechanism handler.

      How to reproduce:
      Setup a DS server without starting it.

      $ touch ./opendj/config/krb5.keytab
      
      $ ./opendj/bin/dsconfig set-sasl-mechanism-handler-prop \
                --handler-name GSSAPI \
                --set enabled:true \
                --set keytab:./opendj/config/krb5.keytab \
                --offline \
                --no-prompt
      
      $ ./opendj/bin/start-ds
      [...]
      [31/Jul/2020:16:15:56 +0200] category=EXTENSIONS severity=ERROR msgID=219 msg=GSSAPI SASL mechanism using a server fully qualified domain name of: localhost
      [31/Jul/2020:16:15:56 +0200] category=EXTENSIONS severity=ERROR msgID=218 msg=GSSAPI mechanism using a principal name of: principal="ldap/localhost
      [31/Jul/2020:16:15:56 +0200] category=CONFIG severity=ERROR msgID=277 msg=An error occurred while trying to initialize an instance of class org.opends.server.extensions.GSSAPISASLMechanismHandler as a SASL mechanism handler as defined in configuration entry cn=GSSAPI,cn=SASL Mechanisms,cn=config: NullPointerException (GSSAPISASLMechanismHandler.java:420 GSSAPISASLMechanismHandler.java:117 GSSAPISASLMechanismHandler.java:82 SASLConfigManager.java:207 SASLConfigManager.java:88 DirectoryServer.java:1710 DirectoryServer.java:1515 StartDs.java:329 DirectoryServer.java:3599)
      

        Attachments

          Activity

            People

            • Assignee:
              cforel carole forel
              Reporter:
              cyril.quinton Cyril Quinton
              Dev Assignee:
              Cyril Quinton
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: