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

Commitb9aaf26

Browse files
committed
Remove the SecTestRandIpRange command option and related code.
1 parent10cee1e commitb9aaf26

File tree

3 files changed

+6
-50
lines changed

3 files changed

+6
-50
lines changed

‎apache2/apache2_config.c‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ void *create_directory_config(apr_pool_t *mp, char *path)
4848

4949
dcfg->root_config=NOT_SET_P;
5050
dcfg->db_option=0;
51-
dcfg->test_ip_range=NOT_SET;
5251
dcfg->agmdb_handles=NOT_SET_P;
5352

5453
dcfg->reqbody_access=NOT_SET;
@@ -328,8 +327,6 @@ void *merge_directory_configs(apr_pool_t *mp, void *_parent, void *_child)
328327
?parent->root_config :child->root_config);
329328
merged->db_option= (child->db_option==NOT_SET
330329
?parent->db_option :child->db_option);
331-
merged->test_ip_range= (child->test_ip_range==NOT_SET
332-
?parent->test_ip_range :child->test_ip_range);
333330
merged->agmdb_handles= (child->agmdb_handles==NOT_SET_P
334331
?parent->agmdb_handles :child->agmdb_handles);
335332

@@ -656,7 +653,6 @@ void init_directory_config(directory_config *dcfg)
656653

657654
if (dcfg->root_config==NOT_SET_P)dcfg->root_config=NULL;
658655
if (dcfg->db_option==NOT_SET)dcfg->db_option=0;
659-
if (dcfg->test_ip_range==NOT_SET)dcfg->test_ip_range=1;
660656
if (dcfg->agmdb_handles==NOT_SET_P)dcfg->agmdb_handles=NULL;
661657

662658
if (dcfg->is_enabled==NOT_SET)dcfg->is_enabled=0;
@@ -1146,15 +1142,6 @@ static const char *update_rule_action(cmd_parms *cmd, directory_config *dcfg,
11461142
returnNULL;
11471143
}
11481144

1149-
/* -- Configuration directives -- */
1150-
staticconstchar*cmd_test_rand_ip_range(cmd_parms*cmd,void*_dcfg,constchar*p1){
1151-
inttmpi;
1152-
directory_config*dcfg= (directory_config*)_dcfg;
1153-
tmpi=atoi(p1);
1154-
dcfg->test_ip_range=tmpi>0 ?tmpi :0;
1155-
returnNULL;
1156-
}
1157-
11581145
staticconstchar*cmd_db_option(cmd_parms*cmd,void*_dcfg,constchar*p1){
11591146
directory_config*dcfg= (directory_config*)_dcfg;
11601147
if((strcmp(p1,"origin")==0))
@@ -3959,14 +3946,6 @@ const command_rec module_directives[] = {
39593946
"Set Hash parameter"
39603947
),
39613948

3962-
AP_INIT_TAKE1 (
3963-
"SecTestRandIpRange",
3964-
cmd_test_rand_ip_range,
3965-
NULL,
3966-
CMD_SCOPE_ANY,
3967-
"IP address range. For test only"
3968-
),
3969-
39703949
AP_INIT_TAKE1 (
39713950
"SecDBOption",
39723951
cmd_db_option,

‎apache2/modsecurity.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,6 @@ struct directory_config {
642642
*/
643643
directory_config*root_config;
644644
intdb_option;
645-
inttest_ip_range;
646645
void*agmdb_handles;
647646

648647
#if0

‎apache2/re_actions.c‎

Lines changed: 6 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1960,28 +1960,6 @@ static apr_status_t init_collection(modsec_rec *msr, const char *real_col_name,
19601960
{
19611961
apr_table_t*table=NULL;
19621962
msc_string*var=NULL;
1963-
staticintcounter_test_col=0;// The suffix of collection key
1964-
char*real_col_key=NULL;// The col_key include the suffix
1965-
intreal_col_key_len;
1966-
1967-
// only increase the ip_suffix_cnt when init ip collection
1968-
if(msr->dcfg1->test_ip_range>1) {
1969-
if(strcmp(col_name,"ip")==0)
1970-
counter_test_col++;
1971-
counter_test_col %=msr->dcfg1->test_ip_range;
1972-
1973-
real_col_key= (char*)apr_pcalloc(msr->mp,strlen(col_key)+20);
1974-
if(real_col_key==NULL) {
1975-
msr_log_error(msr,"[Init_collection]:Cannot alloc space for real_col_key");
1976-
return0;
1977-
}
1978-
1979-
sprintf(real_col_key,"%s_%d",col_key,counter_test_col);
1980-
real_col_key_len=strlen(real_col_key);
1981-
}else {
1982-
real_col_key= (char*)col_key;
1983-
real_col_key_len=col_key_len;
1984-
}
19851963

19861964
/* IMP1 Cannot initialise the built-in collections this way. */
19871965

@@ -1992,14 +1970,14 @@ static apr_status_t init_collection(modsec_rec *msr, const char *real_col_name,
19921970
}
19931971

19941972
/* Init collection from storage. */
1995-
table=collection_retrieve(msr,real_col_name,real_col_key,real_col_key_len);
1973+
table=collection_retrieve(msr,real_col_name,col_key,col_key_len);
19961974

19971975
if (table==NULL) {
19981976
/* Does not exist yet - create new. */
19991977

20001978
if (msr->txcfg->debuglog_level >=4) {
20011979
msr_log(msr,4,"Creating collection (name \"%s\", key \"%s\").",
2002-
real_col_name,real_col_key);
1980+
real_col_name,col_key);
20031981
}
20041982

20051983
table=apr_table_make(msr->mp,24);
@@ -2025,8 +2003,8 @@ static apr_status_t init_collection(modsec_rec *msr, const char *real_col_name,
20252003
var=apr_pcalloc(msr->mp,sizeof(msc_string));
20262004
var->name="KEY";
20272005
var->name_len=strlen(var->name);
2028-
var->value=apr_pstrmemdup(msr->mp,real_col_key,real_col_key_len);
2029-
var->value_len=real_col_key_len;
2006+
var->value=apr_pstrmemdup(msr->mp,col_key,col_key_len);
2007+
var->value_len=col_key_len;
20302008
apr_table_setn(table,var->name, (void*)var);
20312009

20322010
/* The timeout. */
@@ -2049,8 +2027,8 @@ static apr_status_t init_collection(modsec_rec *msr, const char *real_col_name,
20492027
var=apr_pcalloc(msr->mp,sizeof(msc_string));
20502028
var->name="__key";
20512029
var->name_len=strlen(var->name);
2052-
var->value=apr_pstrmemdup(msr->mp,real_col_key,real_col_key_len);
2053-
var->value_len=real_col_key_len;
2030+
var->value=apr_pstrmemdup(msr->mp,col_key,col_key_len);
2031+
var->value_len=col_key_len;
20542032
apr_table_setn(table,var->name, (void*)var);
20552033

20562034
/* Peristence code will need to know the name of the collection. */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp