summaryrefslogtreecommitdiff
path: root/shell/db.js
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-01-30 15:06:12 -0500
committerEliot Horowitz <eliot@10gen.com>2009-01-30 15:06:12 -0500
commit120f8597044a6dec720e7120d208dffb15b64fd2 (patch)
treeb9266339db34e055d6ef997a3223611ddeb9a1f5 /shell/db.js
parentf94aeeea445de1e2d1acf4cc23a94ccb4956d835 (diff)
downloadmongo-120f8597044a6dec720e7120d208dffb15b64fd2.tar.gz
change password digest
from md5( "mongo" + pwd ) to md5( username + ":mongo:" + pwd )
Diffstat (limited to 'shell/db.js')
-rw-r--r--shell/db.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/shell/db.js b/shell/db.js
index ef2d6bf274c..591803bcd04 100644
--- a/shell/db.js
+++ b/shell/db.js
@@ -35,7 +35,7 @@ DB.prototype.addUser = function( username , pass ){
var c = this.getCollection( "system.users" );
var u = c.findOne( { user : username } ) || { user : username };
- u.pwd = hex_md5( "mongo" + pass );
+ u.pwd = hex_md5( username + ":mongo:" + pass );
print( tojson( u ) );
c.save( u );
@@ -49,7 +49,7 @@ DB.prototype.auth = function( username , pass ){
authenticate : 1 ,
user : username ,
nonce : n.nonce ,
- key : hex_md5( n.nonce + username + hex_md5( "mongo" + pass ) )
+ key : hex_md5( n.nonce + username + hex_md5( username + ":mongo:" + pass ) )
}
);