From 984bdf65bb21276f9f4c27ec01f2f51b52421102 Mon Sep 17 00:00:00 2001 From: batrick Date: Thu, 7 Aug 2008 12:32:39 +0000 Subject: [PATCH] Added error message to output for NSE when a script could not be loaded. See: http://seclists.org/nmap-dev/2008/q3/0265.html --- nse_init.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nse_init.cc b/nse_init.cc index 71eaa6e06..39b9aaaac 100644 --- a/nse_init.cc +++ b/nse_init.cc @@ -85,7 +85,8 @@ static int loadfile (lua_State *L) lua_setmetatable(L, -2); if (luaL_loadfile(L, filename) != 0) // load the file (index 3) - luaL_error(L, "'%s' could not be loaded!", filename); + luaL_error(L, "'%s' could not be loaded:\n%s", filename, + lua_tostring(L, -1)); lua_pushvalue(L, -1); lua_pushvalue(L, 2); // push environment table lua_setfenv(L, -2); // set it