doesnt make much sense to specify capped without a size so check for that

This commit is contained in:
dwight
2011-06-11 12:55:46 -04:00
parent 8db6995de2
commit bfe34b1985
6 changed files with 33 additions and 17 deletions

View File

@@ -1744,8 +1744,8 @@ const StringData _jscode_raw_db =
"this.getCollection( \"system.users\" ).remove( { user : username } );\n"
"}\n"
"\n"
"DB.prototype.__pwHash = function( nonce64, username, pass ) {\n"
"return hex_md5( nonce64 + username + hex_md5( username + \":mongo:\" + pass ) );\n"
"DB.prototype.__pwHash = function( nonce, username, pass ) {\n"
"return hex_md5( nonce + username + hex_md5( username + \":mongo:\" + pass ) );\n"
"}\n"
"\n"
"DB.prototype.auth = function( username , pass ){\n"
@@ -1755,8 +1755,8 @@ const StringData _jscode_raw_db =
"{\n"
"authenticate : 1 ,\n"
"user : username ,\n"
"nonce64 : n.nonce64 ,\n"
"key : this.__pwHash( n.nonce64, username, pass )\n"
"nonce : n.nonce ,\n"
"key : this.__pwHash( n.nonce, username, pass )\n"
"}\n"
");\n"
"\n"
@@ -1832,14 +1832,27 @@ const StringData _jscode_raw_db =
"return this._dbCommand( { dropDatabase: 1 } );\n"
"}\n"
"\n"
"\n"
"DB.prototype.shutdownServer = function() {\n"
"/**\n"
"* Shuts down the database. Must be run while using the admin database.\n"
"* @param opts Options for shutdown. Possible options are:\n"
"* - force: (boolean) if the server should shut down, even if there is no\n"
"* up-to-date slave\n"
"* - timeoutSecs: (number) the server will continue checking over timeoutSecs\n"
"* if any other servers have caught up enough for it to shut down.\n"
"*/\n"
"DB.prototype.shutdownServer = function(opts) {\n"
"if( \"admin\" != this._name ){\n"
"return \"shutdown command only works with the admin database; try 'use admin'\";\n"
"}\n"
"\n"
"cmd = {\"shutdown\" : 1};\n"
"opts = opts || {};\n"
"for (var o in opts) {\n"
"cmd[o] = opts[o];\n"
"}\n"
"\n"
"try {\n"
"var res = this._dbCommand(\"shutdown\");\n"
"var res = this.runCommand(cmd);\n"
"if( res )\n"
"throw \"shutdownServer failed: \" + res.errmsg;\n"
"throw \"shutdownServer failed\";\n"
@@ -1925,7 +1938,7 @@ const StringData _jscode_raw_db =
"fromhost = fromhost || \"\";\n"
"if ( username && password ) {\n"
"var n = this._adminCommand( { copydbgetnonce : 1, fromhost:fromhost } );\n"
"return this._adminCommand( { copydb:1, fromhost:fromhost, fromdb:fromdb, todb:todb, username:username, nonce64:n.nonce64, key:this.__pwHash( n.nonce64, username, password ) } );\n"
"return this._adminCommand( { copydb:1, fromhost:fromhost, fromdb:fromdb, todb:todb, username:username, nonce:n.nonce, key:this.__pwHash( n.nonce, username, password ) } );\n"
"} else {\n"
"return this._adminCommand( { copydb:1, fromhost:fromhost, fromdb:fromdb, todb:todb } );\n"
"}\n"