diff options
author | Spencer T Brody <spencer@mongodb.com> | 2014-03-28 17:39:12 -0400 |
---|---|---|
committer | Spencer T Brody <spencer@mongodb.com> | 2014-04-03 12:54:51 -0400 |
commit | 30a93a1016c2dc550ab3de3e5bf0e8155209645f (patch) | |
tree | b0d288fd5ffc05e1fa8d7ac49935415bed9b401f /src/mongo/shell/db.js | |
parent | abf252cfe8833ab15dc8d62e8e05a30108484508 (diff) | |
download | mongo-30a93a1016c2dc550ab3de3e5bf0e8155209645f.tar.gz |
SERVER-13427 Make sure password is a string when creating users in the shell
Diffstat (limited to 'src/mongo/shell/db.js')
-rw-r--r-- | src/mongo/shell/db.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/shell/db.js b/src/mongo/shell/db.js index e9572e7d8cb..3a714b3a984 100644 --- a/src/mongo/shell/db.js +++ b/src/mongo/shell/db.js @@ -1005,6 +1005,10 @@ DB.prototype._createUser = function(userObj, writeConcern) { } function _hashPassword(username, password) { + if (typeof password != 'string') { + throw Error("User passwords must be of type string. Was given password with type: " + + typeof(password)); + } return hex_md5(username + ":mongo:" + password); } |