Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit20014c8

Browse files
author
Felipe "Zimmerle" Costa
committed
Adds modsecStatusEngineCall to standalone API
In ModSecurityIIS the configuration is loaded upon the first requestis received. In other words, SecStatusEngine value can be onlyloaded once the first request hit the server, and so, the statusfunction was moved to proceed just after the configuration got loaded.This update is IIS only.
1 parentd75e443 commit20014c8

File tree

6 files changed

+28
-2
lines changed

6 files changed

+28
-2
lines changed

‎apache2/mod_security2.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,7 @@ static int hook_post_config(apr_pool_t *mp, apr_pool_t *mp_log, apr_pool_t *mp_t
726726
"Original server signature: %s",real_server_signature);
727727
}
728728

729+
#ifndefWIN32
729730
if (status_engine_state!=STATUS_ENGINE_DISABLED) {
730731
msc_status_engine_call();
731732
}
@@ -734,6 +735,7 @@ static int hook_post_config(apr_pool_t *mp, apr_pool_t *mp_log, apr_pool_t *mp_t
734735
"Status engine is currently disabled, enable it by set " \
735736
"SecStatusEngine to On.");
736737
}
738+
#endif
737739
}
738740

739741
srand((unsignedint)(time(NULL)*getpid()));

‎apache2/msc_status_engine.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -356,8 +356,8 @@ int msc_status_engine_call (void) {
356356
}
357357

358358
apr_snprintf(beacon_string,beacon_string_len+1+10+4,
359-
"%s,%s/IIS,%s/%s,%s/%s,%s/%s,%s/%s,%s",
360-
modsec,apache,apr,apr_loaded,pcre,pcre_loaded,lua,lua_loaded,
359+
"%s,IIS,%s/%s,%s/%s,%s/%s,%s/%s,%s",
360+
modsec,apr,apr_loaded,pcre,pcre_loaded,lua,lua_loaded,
361361
libxml,libxml_loaded,id);
362362
#else
363363
beacon_string=malloc(sizeof(char)*(beacon_string_len+1+10));

‎apache2/msc_status_engine.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@
2121
#include"apr_optional.h"
2222
#include"msc_pcre.h"
2323

24+
#ifndefWIN32
2425
#defineSTATUS_ENGINE_DNS_IN_BETWEEN_DOTS 32
26+
#else
27+
#defineSTATUS_ENGINE_DNS_IN_BETWEEN_DOTS 30
28+
#endif
2529

2630
#defineSTATUS_ENGINE_DNS_SUFFIX "status.modsecurity.org"
2731

‎iis/mymodule.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,9 @@ CMyHttpModule::OnBeginRequest(
796796
delete path;
797797
goto Finished;
798798
}
799+
800+
modsecStatusEngineCall();
801+
799802
}
800803
delete apppath;
801804
}

‎standalone/api.c‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -701,3 +701,16 @@ const char *modsecIsServerSignatureAvailale(void) {
701701
returnnew_server_signature;
702702
}
703703

704+
#ifdefWIN32
705+
voidmodsecStatusEngineCall()
706+
{
707+
if (status_engine_state!=STATUS_ENGINE_DISABLED) {
708+
msc_status_engine_call();
709+
}
710+
else {
711+
ap_log_error(APLOG_MARK,APLOG_NOTICE,0,NULL,
712+
"Status engine is currently disabled, enable it by set " \
713+
"SecStatusEngine to On.\n");
714+
}
715+
}
716+
#endif

‎standalone/api.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ void modsecSetConfigForIISRequestBody(request_rec *r);
119119

120120
constchar*modsecIsServerSignatureAvailale(void);
121121

122+
#ifdefWIN32
123+
voidmodsecStatusEngineCall(void);
124+
#endif
125+
122126
#ifdef__cplusplus
123127
}
124128
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp