Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-2863

cs.AuthMechanismProperties is not initialized when mechanism set by --authenticationMechanism

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 100.5.0
    • None
    • None
    • None

    Description

      Inside this block in setOptionsFromURI():

      if opts.Kerberos.Service != "" && !cs.AuthMechanismPropertiesSet {
          cs.AuthMechanismProperties["SERVICE_NAME"] = opts.Kerberos.Service
          cs.AuthMechanismPropertiesSet = true        
      }

      cs.AuthMechanismProperties is not initialized if the auth mechanism was not specified in the URI (i.e. it didn't get initialized during connstring.Parse()).

      We need to do the same thing that we do for the mongodb-aws mechanism and add this to the start of the block:

      if cs.AuthMechanismProperties == nil {
          cs.AuthMechanismProperties = make(map[string]string)
      } 

       

      Attachments

        Activity

          People

            huan.li@mongodb.com Huan Li
            tim.fogarty@mongodb.com Tim Fogarty
            Tim Fogarty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: