mirror of
https://github.com/nmap/nmap.git
synced 2025-12-07 13:11:28 +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);
|
lua_newtable(L);
|
||||||
luaL_register(L, NULL, nse);
|
luaL_register(L, NULL, nse);
|
||||||
/* Add some other fields */
|
/* Add some other fields */
|
||||||
lua_pushboolean(L, o.script == 1); /* default scripts if none enumerated? */
|
setbfield(L, -1, "default", o.script == 1);
|
||||||
lua_setfield(L, -2, "default");
|
setbfield(L, -1, "scriptversion", o.scriptversion == 1);
|
||||||
lua_pushboolean(L, o.scriptversion == 1);
|
setbfield(L, -1, "scriptupdatedb", o.scriptupdatedb == 1);
|
||||||
lua_setfield(L, -2, "scriptversion");
|
setsfield(L, -1, "script_dbpath", SCRIPT_ENGINE_DATABASE);
|
||||||
lua_pushboolean(L, o.scriptupdatedb == 1);
|
setsfield(L, -1, "scriptargs", o.scriptargs);
|
||||||
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");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptResult::set_output (const char *out)
|
void ScriptResult::set_output (const char *out)
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ void close_nse (void);
|
|||||||
# define SCRIPT_ENGINE_LIB_DIR "nselib/"
|
# define SCRIPT_ENGINE_LIB_DIR "nselib/"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SCRIPT_ENGINE_DATABASE "script.db"
|
#define SCRIPT_ENGINE_DATABASE SCRIPT_ENGINE_LUA_DIR "script.db"
|
||||||
#define SCRIPT_ENGINE_EXTENSION ".nse"
|
#define SCRIPT_ENGINE_EXTENSION ".nse"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user