mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 06:40:48 +00:00
make --script-updatedb skip scripts producing load errors
This commit is contained in:
parent
466a760e67
commit
abd40e3f96
1 changed files with 10 additions and 1 deletions
11
nse_init.cc
11
nse_init.cc
|
|
@ -452,7 +452,16 @@ int init_updatedb (lua_State *L)
|
|||
luaL_error(L, "file '%s' could not be loaded", file);
|
||||
lua_pushvalue(L, -2); // push environment
|
||||
lua_setfenv(L, -2); // set it
|
||||
lua_call(L, 0, 0);
|
||||
if ( lua_pcall(L, 0, 0, 0) != 0 ) {
|
||||
// skip scripts that produce errors
|
||||
log_write(LOG_STDOUT, "%s: Skipping script '%s' because it produced errors while loading.\n",
|
||||
SCRIPT_ENGINE, file );
|
||||
SCRIPT_ENGINE_VERBOSE(
|
||||
error("%s", lua_tostring(L, -1));
|
||||
)
|
||||
lua_pop(L, 3);
|
||||
continue;
|
||||
}
|
||||
|
||||
lua_getfield(L, -1, "categories");
|
||||
if (lua_isnil(L, -1))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue