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

mongotools needs to be able to read password from something other than command line flags

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.0.2, 3.1.1
    • Affects Version/s: None
    • Component/s: All Tools
    • None
    • Environment:
      windows
    • Iteration 0, Iteration 3.1.0, Kernel Tools Iteration 3.1.1
    • Completed
    • v3.0

      To reproduce, launch a mongod instance with a username / password (jim and password in this case).

      UNIX session
      $ cat << EOF > password.json
      heredoc> password
      heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acae" } }
      heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acaf" } }
      heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acb0" } }
      heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acb1" } }
      heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acb2" } }
      heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acb3" } }
      heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acb4" } }
      heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acb5" } }
      heredoc> { "_id" : { "$oid" : "54898ddc31e8ec20a062acb6" } }
      heredoc> EOF
      
      $ mongoimport --drop --db my_cms --collection docs --username jim --password --authenticationDatabase admin < password.json
      connected to: 127.0.0.1
      Enter password:
      Fri Dec 12 11:02:05.917 dropping: my_cms.docs
      Fri Dec 12 11:02:05.921 imported 9 objects
      
      
      Windows session
      C:\jim>mongoimport --host XX.XX.XX.XXX -username jim --password  --authenticationDatabase admin --db my_cms --collection docs < password.json
      connected to: 10.7.31.244
      Enter password: Cannot get console mode 6
      assertion: 18 { code: 18, ok: 0.0, errmsg: "auth fails" }
      
      

            Assignee:
            kyle.erf Kyle Erf
            Reporter:
            jim.oleary@mongodb.com James O'Leary
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: