summaryrefslogtreecommitdiff
path: root/src/mongo/shell
diff options
context:
space:
mode:
authorAndreas Nilsson <andreas.nilsson@10gen.com>2014-11-03 12:56:39 -0500
committerAndreas Nilsson <andreas.nilsson@10gen.com>2014-11-03 12:58:11 -0500
commit4026a60ee751a5190efb893539f65381bf173bc7 (patch)
treeaba5e2d8c4e5d10c4ad532b9d182ba18587c8bc5 /src/mongo/shell
parent1bb29da08f761b4ed79c8bb1cacb74aaec702530 (diff)
downloadmongo-4026a60ee751a5190efb893539f65381bf173bc7.tar.gz
SERVER-15684 Make copydb from localhost not call auth
Diffstat (limited to 'src/mongo/shell')
-rw-r--r--src/mongo/shell/db.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/shell/db.js b/src/mongo/shell/db.js
index 896597f268b..e43bb4f0de8 100644
--- a/src/mongo/shell/db.js
+++ b/src/mongo/shell/db.js
@@ -269,8 +269,8 @@ DB.prototype.copyDatabase = function(fromdb, todb, fromhost, username, password)
var mechanism = this._getDefaultAuthenticationMechanism();
assert(mechanism == "SCRAM-SHA-1" || mechanism == "MONGODB-CR");
- // Check for no auth
- if (!username || !password) {
+ // Check for no auth or copying from localhost
+ if (!username || !password || fromhost == "") {
return this._adminCommand( { copydb:1, fromhost:fromhost, fromdb:fromdb, todb:todb } );
}