db.auth() shouldn't mutate its argument

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.5.5
    • Affects Version/s: 2.4.8, 2.5.3
    • Component/s: Security, Shell
    • None
    • Minor Change
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Calling db.auth() with a document as the arg mutates the document by adding a "mechanism" and a "userSource" or "db" field to the doc. This prevents the same doc from being used for a future auth call.

      > var authDoc = {user:'spencer', pwd:'pwd'}
      > db.auth(authDoc)
      1
      > authDoc
      {
              "user": "spencer",
              "pwd": "pwd",
              "mechanism": "MONGODB-CR",
              "db": "test"
      }
      

            Assignee:
            Andy Schwerin
            Reporter:
            Spencer Brody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: