-
Type: Bug
-
Resolution: Done
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: Security, Testing Infrastructure
-
Fully Compatible
-
ALL
-
Server 2.7.3
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).
Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
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 {