1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-10 09:49:05 +00:00

Move string utility functions to stringaux.lua

This commit is contained in:
dmiller
2018-10-18 01:08:19 +00:00
parent 39cfbdf4e2
commit 0500811f5a
140 changed files with 521 additions and 418 deletions

View File

@@ -31,7 +31,6 @@ Helper = {
end,
login = function(self, repo, user, pass )
local auth_tab = {}
assert(repo, "No repository was specified")
assert(user, "No user was specified")
assert(pass, "No pass was specified")
@@ -39,13 +38,15 @@ Helper = {
-- Add a leading slash if it's missing
if ( repo:sub(1,1) ~= "/" ) then repo = "/" .. repo end
table.insert(auth_tab, "BEGIN AUTH REQUEST")
table.insert(auth_tab, repo)
table.insert(auth_tab, user)
table.insert(auth_tab, Util.pwscramble(pass))
table.insert(auth_tab, "END AUTH REQUEST")
local auth_tab = {
"BEGIN AUTH REQUEST",
repo,
user,
Util.pwscramble(pass),
"END AUTH REQUEST\n",
}
local data = stdnse.strjoin("\n", auth_tab) .. "\n"
local data = table.concat(auth_tab, "\n")
local status = self.socket:send(data)
if ( not(status) ) then return false, "Failed to send login request" end