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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 100.5.0
    • Component/s: None
    • Labels:
      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

            Assignee:
            huan.li Huan Li
            Reporter:
            tim.fogarty Tim Fogarty
            Reviewers:
            Tim Fogarty
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: