diff options
author | David Golden <xdg@xdg.me> | 2019-05-21 09:57:39 -0400 |
---|---|---|
committer | David Golden <xdg@xdg.me> | 2019-05-21 10:49:58 -0400 |
commit | f09fa890550e6da02656fbb2df33837bf2bdad50 (patch) | |
tree | 8f9767007a25341c5facf8de2c8170310261077d /src/mongo | |
parent | f36aaeddbb86f47a0bd0dff2e541c73b834f05f7 (diff) | |
download | mongo-f09fa890550e6da02656fbb2df33837bf2bdad50.tar.gz |
Import tools: 25f23659be74d2f882ead1a9882b66872214f369 from branch v4.1
ref: 10612b00bf..25f23659be
for: 4.1.12
TOOLS-2293 Specifying no database in the URI triggers auth
Diffstat (limited to 'src/mongo')
3 files changed, 8 insertions, 4 deletions
diff --git a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/Gopkg.lock b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/Gopkg.lock index 6a56a375efd..b8e973ece01 100644 --- a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/Gopkg.lock +++ b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/Gopkg.lock @@ -104,7 +104,7 @@ [[projects]] branch = "master" - digest = "1:c1e7c7400eab4665796e35dd486992d480942ef46d8bfd4d2ffcc4c4352e8b3b" + digest = "1:d60f927aee2981fec0cc764cc118f202964b6023ada356e532b6c708e489ec26" name = "github.com/mongodb/mongo-tools-common" packages = [ "archive", @@ -125,7 +125,7 @@ "util", ] pruneopts = "T" - revision = "1ca4ef7aeca6bbf734acd4122f3cfa36bda74b6e" + revision = "4316ec1965c626bbe74458444880c40950565e64" [[projects]] digest = "1:f363c75e8cac5653bc5c0c2b90cbd8a522fdc48c13a5f8d85078750f82d1a009" diff --git a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/import.data b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/import.data index 86a936a88d8..e3a82705d12 100644 --- a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/import.data +++ b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/import.data @@ -1,5 +1,5 @@ { - "commit": "10612b00bf0ad7f13d3980bbe5c0f37aca675d9b", + "commit": "25f23659be74d2f882ead1a9882b66872214f369", "github": "mongodb/mongo-tools.git", "vendor": "tools", "branch": "v4.1" diff --git a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/options/options.go b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/options/options.go index c4199202e59..87289c99f7b 100644 --- a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/options/options.go +++ b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/vendor/github.com/mongodb/mongo-tools-common/options/options.go @@ -524,7 +524,11 @@ func (opts *ToolOptions) setOptionsFromURI(cs connstring.ConnString) error { } opts.Username = cs.Username opts.Password = cs.Password - opts.Source = cs.AuthSource + // Only set Source if it's not the Go driver default; that means a user must + // have passed an authsource option or provided a database in the URI path. + if _, ok := cs.Options["authsource"]; ok || cs.Database != "" { + opts.Source = cs.AuthSource + } opts.Auth.Mechanism = cs.AuthMechanism } if opts.enabledOptions.Namespace { |