1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-23 16:09:02 +00:00

Fix local variable shadowing a method. Credit Martin Holst Swende

This commit is contained in:
dmiller
2014-03-06 23:10:01 +00:00
parent 3b3131d635
commit f4765340a3

View File

@@ -601,8 +601,8 @@ end
function login(socket, db, username, password) function login(socket, db, username, password)
local collectionName = ("%s.$cmd"):format(arg_DB or db) local collectionName = ("%s.$cmd"):format(arg_DB or db)
local query = { getnonce = 1 } local q = { getnonce = 1 }
local status, packet = createQuery(collectionName, query) local status, packet = createQuery(collectionName, q)
local response local response
status, response = query(socket, packet) status, response = query(socket, packet)
if ( not(status) or not(response.nonce) ) then if ( not(status) or not(response.nonce) ) then
@@ -613,10 +613,10 @@ function login(socket, db, username, password)
local pwdigest = stdnse.tohex(openssl.md5(username .. ':mongo:' ..password)) local pwdigest = stdnse.tohex(openssl.md5(username .. ':mongo:' ..password))
local digest = stdnse.tohex(openssl.md5(nonce .. username .. pwdigest)) local digest = stdnse.tohex(openssl.md5(nonce .. username .. pwdigest))
query = { user = username, nonce = nonce, key = digest } q = { user = username, nonce = nonce, key = digest }
query._cmd = { authenticate = 1 } q._cmd = { authenticate = 1 }
local status, packet = createQuery(collectionName, query) local status, packet = createQuery(collectionName, q)
status, response = query(socket, packet) status, response = query(socket, packet)
if ( not(status) ) then if ( not(status) ) then
return status, response return status, response