mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
use utility functions
This commit is contained in:
15
nse_main.cc
15
nse_main.cc
@@ -217,16 +217,11 @@ static void open_cnse (lua_State *L)
|
||||
lua_newtable(L);
|
||||
luaL_register(L, NULL, nse);
|
||||
/* Add some other fields */
|
||||
lua_pushboolean(L, o.script == 1); /* default scripts if none enumerated? */
|
||||
lua_setfield(L, -2, "default");
|
||||
lua_pushboolean(L, o.scriptversion == 1);
|
||||
lua_setfield(L, -2, "scriptversion");
|
||||
lua_pushboolean(L, o.scriptupdatedb == 1);
|
||||
lua_setfield(L, -2, "scriptupdatedb");
|
||||
lua_pushliteral(L, SCRIPT_ENGINE_LUA_DIR SCRIPT_ENGINE_DATABASE);
|
||||
lua_setfield(L, -2, "script_dbpath");
|
||||
lua_pushstring(L, o.scriptargs);
|
||||
lua_setfield(L, -2, "scriptargs");
|
||||
setbfield(L, -1, "default", o.script == 1);
|
||||
setbfield(L, -1, "scriptversion", o.scriptversion == 1);
|
||||
setbfield(L, -1, "scriptupdatedb", o.scriptupdatedb == 1);
|
||||
setsfield(L, -1, "script_dbpath", SCRIPT_ENGINE_DATABASE);
|
||||
setsfield(L, -1, "scriptargs", o.scriptargs);
|
||||
}
|
||||
|
||||
void ScriptResult::set_output (const char *out)
|
||||
|
||||
@@ -59,7 +59,7 @@ void close_nse (void);
|
||||
# define SCRIPT_ENGINE_LIB_DIR "nselib/"
|
||||
#endif
|
||||
|
||||
#define SCRIPT_ENGINE_DATABASE "script.db"
|
||||
#define SCRIPT_ENGINE_DATABASE SCRIPT_ENGINE_LUA_DIR "script.db"
|
||||
#define SCRIPT_ENGINE_EXTENSION ".nse"
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user