From 120f8597044a6dec720e7120d208dffb15b64fd2 Mon Sep 17 00:00:00 2001 From: Eliot Horowitz Date: Fri, 30 Jan 2009 15:06:12 -0500 Subject: change password digest from md5( "mongo" + pwd ) to md5( username + ":mongo:" + pwd ) --- shell/db.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'shell/db.js') 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 ) ) } ); -- cgit v1.2.1