On Wed, May 04, 2011 at 05:07:57PM -0400, Patrick Donnelly wrote:
On Mon, Mar 28, 2011 at 1:02 PM, Patrick Donnelly <batrick () batbytes com> wrote:
So I wrote up a quick patch to make require errors easier for scripts.
Basically, you can now require libraries that may not exist without
having to use pcall. See also .
This is committed as of revision 23085. The "root" module has been
removed in favor of keeping the check for root access in the rule
function. The require function has been modified so that NSE can
silently catch require errors. If you want/need to use the real
require function, it is available as stdnse.require.
This can cause some confusion during --script-updatedb. There was an
error in ncp.lua where "ipOps" was written "ipops" and failed to import
on a case-sensistive filesystem. The quiet require errors led to a
confusing error message:
$ ./nmap --script-updatedb
Starting Nmap 5.51SVN ( http://nmap.org ) at 2011-06-07 23:08 PDT
NSE: Updating rule database.
NSE: failed to initialize the script engine:
/home/david/nmap-git/nse_main.lua:1017: attempt to index local 'script' (a nil value)
/home/david/nmap-git/nse_main.lua:1017: in main chunk
Running with -d shows a stack trace and makes it more obvious what the
problem is ("module 'ipops' not found"), but can we do anything about