1
0
mirror of https://github.com/nmap/nmap.git synced 2026-01-06 14:39:03 +00:00

Added code to brute library that picks up the executing SCRIPT_NAME using getfenv [Patrik]

This commit is contained in:
patrik
2011-11-13 12:56:29 +00:00
parent 4edf096715
commit 776a11146e

View File

@@ -623,7 +623,10 @@ Engine =
local cvar = {}
local condvar = nmap.condvar( cvar )
local script_env = getfenv(2)
-- get the SCRIPT_NAME of the executing script
self.options.script_name = self.options.script_name or script_env.SCRIPT_NAME
assert(self.options.script_name, "SCRIPT_NAME was not set in options.script_name")
assert(self.port.number and self.port.protocol, "Invalid port table detected")
self.port.service = self.port.service or "unknown"