mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 11:16:33 +03:00
Adds support to status engine on IIS version
Fixes on the windows versions: build, mac address and machine name retrieval
This commit is contained in:
@@ -12,7 +12,8 @@ LIBS = $(APACHE)\lib\libhttpd.lib \
|
||||
$(APACHE)\lib\libaprutil-1.lib \
|
||||
$(PCRE)\pcre.lib \
|
||||
$(LIBXML2)\win32\bin.msvc\libxml2.lib \
|
||||
Ws2_32.lib
|
||||
Ws2_32.lib \
|
||||
"iphlpapi.lib"
|
||||
|
||||
###########################################################################
|
||||
###########################################################################
|
||||
@@ -46,7 +47,8 @@ OBJS = mod_security2.obj apache2_config.obj apache2_io.obj apache2_util.obj \
|
||||
msc_logging.obj msc_xml.obj msc_multipart.obj modsecurity.obj \
|
||||
msc_parsers.obj msc_util.obj msc_pcre.obj persist_dbm.obj \
|
||||
msc_reqbody.obj msc_geo.obj msc_gsb.obj msc_crypt.obj msc_tree.obj msc_unicode.obj acmp.obj msc_lua.obj \
|
||||
msc_release.obj libinjection\libinjection_sqli.obj
|
||||
msc_release.obj libinjection\libinjection_sqli.obj \
|
||||
msc_status_engine.obj
|
||||
|
||||
all: $(DLL)
|
||||
|
||||
|
@@ -2083,7 +2083,7 @@ static const char *cmd_rule_engine(cmd_parms *cmd, void *_dcfg, const char *p1)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static const char *cmd_STATUS_ENGINE(cmd_parms *cmd, void *_dcfg, const char *p1)
|
||||
static const char *cmd_status_engine(cmd_parms *cmd, void *_dcfg, const char *p1)
|
||||
{
|
||||
if (strcasecmp(p1, "on") == 0) {
|
||||
status_engine_state = STATUS_ENGINE_ENABLED;
|
||||
|
@@ -96,14 +96,14 @@ void DSOLOCAL msc_status_engine_fill_with_dots(char *encoded_with_dots,
|
||||
// Based on:
|
||||
// http://stackoverflow.com/questions/16858782/how-to-obtain-almost-unique-system-identifier-in-a-cross-platform-way
|
||||
int DSOLOCAL msc_status_engine_machine_name(char *machine_name, size_t len) {
|
||||
#ifdef WIN32
|
||||
DWORD lenComputerName = len;
|
||||
#endif
|
||||
|
||||
memset(machine_name, '\0', sizeof(char) * len);
|
||||
|
||||
#ifdef WIN32
|
||||
DWORD size = 1024;
|
||||
GetComputerName(machine_name, &size);
|
||||
|
||||
apr_snprintf(machine_name, len-1, "%s", computerName[0]);
|
||||
machine_name[len - 1] = '\0';
|
||||
GetComputerName(machine_name, &lenComputerName);
|
||||
#else
|
||||
static struct utsname u;
|
||||
|
||||
|
Reference in New Issue
Block a user