mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 04:31:29 +00:00
Some scripts would fail due to an error (whois.nse) causing other scripts to become deadlocked on a mutex that would never unlock. This patch fixes this problem. See [1] for more information. [1] http://seclists.org/nmap-dev/2009/q2/0533.html
44 lines
740 B
C++
44 lines
740 B
C++
#ifndef NMAP_LUA_H
|
|
#define NMAP_LUA_H
|
|
|
|
#include <vector>
|
|
#include <list>
|
|
#include <string>
|
|
#include <string.h>
|
|
#include <iostream>
|
|
|
|
extern "C" {
|
|
#include "lua.h"
|
|
#include "lualib.h"
|
|
#include "lauxlib.h"
|
|
}
|
|
|
|
class ScriptResult
|
|
{
|
|
private:
|
|
std::string output;
|
|
std::string id;
|
|
public:
|
|
void set_output (const char *);
|
|
std::string get_output (void);
|
|
void set_id (const char *);
|
|
std::string get_id (void);
|
|
};
|
|
|
|
typedef std::vector<ScriptResult> ScriptResults;
|
|
|
|
class Target;
|
|
|
|
int script_updatedb();
|
|
void script_scan_free();
|
|
|
|
/* API */
|
|
void nse_restore (lua_State *, int);
|
|
void nse_destructor (lua_State *, char);
|
|
|
|
int open_nse (void);
|
|
int script_scan(std::vector<Target *> &targets);
|
|
void close_nse (void);
|
|
|
|
#endif
|