Details
-
Bug
-
Resolution: Done
-
Minor - P4
-
None
-
Fully Compatible
-
ALL
-
Server 2.7.3
Description
Based on
the server strips out all forms of whitespace from keyfiles.
However, ShardingTest and authutil.asCluster both incorrectly strip only spaces and newlines, instead of everything between 011 and 015, and space (040).
diff --git a/src/mongo/shell/shardingtest.js b/src/mongo/shell/shardingtest.js
|
index 282ccd0..b3c0a11 100644
|
--- a/src/mongo/shell/shardingtest.js
|
+++ b/src/mongo/shell/shardingtest.js
|
@@ -387,7 +387,7 @@ ShardingTest = function( testName , numShards , verboseLevel , numMongos , other
|
authutil.assertAuthenticate(this._mongos, 'admin', {
|
user: '__system',
|
mechanism: 'MONGODB-CR',
|
- pwd: cat(keyFile).replace(/[ \n]/g, '')
|
+ pwd: cat(keyFile).replace(/[\011-\015\040]/g, '')
|
});
|
|
|
try {
|
diff --git a/src/mongo/shell/utils_auth.js b/src/mongo/shell/utils_auth.js
|
index 67e44d1..ff8f154 100644
|
--- a/src/mongo/shell/utils_auth.js
|
+++ b/src/mongo/shell/utils_auth.js
|
@@ -72,7 +72,7 @@ var authutil;
|
authutil.assertAuthenticate(conn, 'local', {
|
user: '__system',
|
mechanism: 'MONGODB-CR',
|
- pwd: cat(keyfile).replace(/[ \n]/g, '')
|
+ pwd: cat(keyfile).replace(/[\011-\015\040]/g, '')
|
});
|
|
|
try {
|