Nmap Development mailing list archives

[NSE][PATCH] only show script errors in verbose mode


From: Sven Klemm <sven () c3d2 de>
Date: Tue, 23 Sep 2008 09:59:46 +0200

Hi everyone,

this patch changes nmap to only show script errors that happen while loading scripts when verbose or debugging is set.

Cheers,
Sven

--
Sven Klemm
http://cthulhu.c3d2.de/~sven/

Index: nse_init.cc
===================================================================
--- nse_init.cc (revision 10327)
+++ nse_init.cc (revision 10328)
@@ -113,8 +113,10 @@
   lua_setfenv(L, -2); // set it
   if (lua_pcall(L, 0, 0, 0) != 0) // Call the function (loads globals)
   {
-    error("%s: '%s' threw a run time error and could not be loaded.",
+    SCRIPT_ENGINE_VERBOSE(
+      error("%s: '%s' threw a run time error and could not be loaded.",
         SCRIPT_ENGINE, filename);
+    )
     SCRIPT_ENGINE_DEBUGGING(
       error("%s", lua_tostring(L, -1));
     )

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org

Current thread: