PATH:
usr
/
share
/
nmap
/
nselib
--- -- Strict declared global library. Checks for undeclared global variables -- during runtime execution. -- -- This module places the <code>strict</code> function in the global -- environment. The strict function allows a script to add runtime checking so -- that undeclared globals cause an error to be raised. This is useful for -- finding accidental use of globals when local was intended. -- -- A global variable is considered "declared" if the script makes an assignment -- to the global name (even <code>nil</code>) in the file scope. -- -- @class module -- @name strict -- @copyright Copyright© Same as Nmap--See http://nmap.org/book/man-legal.html local debug = require "debug" local error = error; local getmetatable = getmetatable; local rawset = rawset; local rawget = rawget; local setmetatable = setmetatable; local type = type; local getinfo = debug.getinfo; _ENV = {}; local function what () local d = getinfo(3, "S"); return d and d.what or "C"; end --- The strict function. -- -- This function adds runtime checking to the global environment for use of -- undeclared globals. A global is 'undeclared' if not assigned in the file -- (script) scope previously. An error will be raised on use of an undeclared -- global. -- -- This function should be passed last to stdnse.module in order to allow -- other environment option functions (e.g. stdnse.seeall) to change the -- environment first. This is important for allowing globals outside the -- library (in _G) to be indexed. -- -- @see stdnse.module -- @usage -- _ENV = stdnse.module(name, require "strict"); -- @param env The environment to modify. local function strict (env) local mt = getmetatable(env) or setmetatable(env, {}) and getmetatable(env); local _newindex, _index = mt.__newindex, mt.__index; mt.__declared = {}; function mt.__newindex (t, n, v) if type(_newindex) == "function" then _newindex(t, n, v); -- hook it end if not mt.__declared[n] then local w = what(); if w ~= "main" and w ~= "C" then error("assign to undeclared variable '"..n.."'", 2); end mt.__declared[n] = true; end rawset(t, n, v); end function mt.__index (t, n) if type(_index) == "function" then local v = _index(t, n); -- hook it if v ~= nil then return v end elseif _index ~= nil then local v = _index[n]; if v ~= nil then return v end end if not mt.__declared[n] and what() ~= "C" then error("variable '"..n.."' is not declared", 2); end return rawget(t, n); end return env; end return strict;
[-] iscsi.lua
[edit]
[-] httpspider.lua
[edit]
[-] rmi.lua
[edit]
[-] socks.lua
[edit]
[-] dhcp6.lua
[edit]
[-] sasl.lua
[edit]
[-] drda.lua
[edit]
[+]
data
[-] dhcp.lua
[edit]
[-] omp2.lua
[edit]
[-] ospf.lua
[edit]
[-] ipp.lua
[edit]
[-] pop3.lua
[edit]
[-] netbios.lua
[edit]
[-] pgsql.lua
[edit]
[-] packet.lua
[edit]
[-] rpc.lua
[edit]
[-] xdmcp.lua
[edit]
[-] msrpc.lua
[edit]
[+]
..
[-] eigrp.lua
[edit]
[-] giop.lua
[edit]
[-] afp.lua
[edit]
[-] bjnp.lua
[edit]
[-] match.lua
[edit]
[-] iax2.lua
[edit]
[-] smtp.lua
[edit]
[-] msrpctypes.lua
[edit]
[-] cvs.lua
[edit]
[-] natpmp.lua
[edit]
[-] bitcoin.lua
[edit]
[-] snmp.lua
[edit]
[-] rsync.lua
[edit]
[-] mssql.lua
[edit]
[-] base64.lua
[edit]
[-] ncp.lua
[edit]
[-] base32.lua
[edit]
[-] sip.lua
[edit]
[-] http.lua
[edit]
[-] asn1.lua
[edit]
[-] stun.lua
[edit]
[-] citrixxml.lua
[edit]
[-] nrpc.lua
[edit]
[-] proxy.lua
[edit]
[-] pppoe.lua
[edit]
[-] amqp.lua
[edit]
[-] dns.lua
[edit]
[-] informix.lua
[edit]
[-] tftp.lua
[edit]
[-] sslcert.lua
[edit]
[-] strbuf.lua
[edit]
[-] unpwdb.lua
[edit]
[-] strict.lua
[edit]
[-] vulns.lua
[edit]
[-] jdwp.lua
[edit]
[-] stdnse.lua
[edit]
[-] dnssd.lua
[edit]
[-] mysql.lua
[edit]
[-] rdp.lua
[edit]
[-] mongodb.lua
[edit]
[-] ndmp.lua
[edit]
[-] isns.lua
[edit]
[-] ldap.lua
[edit]
[-] creds.lua
[edit]
[-] tab.lua
[edit]
[-] ftp.lua
[edit]
[-] brute.lua
[edit]
[-] comm.lua
[edit]
[-] ipOps.lua
[edit]
[-] mobileme.lua
[edit]
[-] target.lua
[edit]
[-] rpcap.lua
[edit]
[-] eap.lua
[edit]
[-] cassandra.lua
[edit]
[-] ssh1.lua
[edit]
[-] url.lua
[edit]
[-] datafiles.lua
[edit]
[-] ajp.lua
[edit]
[-] vuzedht.lua
[edit]
[-] nsedebug.lua
[edit]
[-] rtsp.lua
[edit]
[-] shortport.lua
[edit]
[-] bittorrent.lua
[edit]
[-] ssh2.lua
[edit]
[-] msrpcperformance.lua
[edit]
[-] listop.lua
[edit]
[-] dnsbl.lua
[edit]
[-] json.lua
[edit]
[-] redis.lua
[edit]
[-] wsdd.lua
[edit]
[-] tns.lua
[edit]
[-] ike.lua
[edit]
[-] gps.lua
[edit]
[-] versant.lua
[edit]
[-] imap.lua
[edit]
[-] smb.lua
[edit]
[-] smbauth.lua
[edit]
[-] xmpp.lua
[edit]
[-] upnp.lua
[edit]
[-] membase.lua
[edit]
[-] vnc.lua
[edit]
[-] srvloc.lua
[edit]