Skip to content

Commit 5122f89

Browse files
author
Marc Stern
committed
defined id_log() only once
1 parent 556835c commit 5122f89

File tree

4 files changed

+5
-13
lines changed

4 files changed

+5
-13
lines changed

apache2/apache2_config.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,9 @@
3131
#endif
3232

3333
// Returns the rule id if existing, otherwise the file name & line number
34-
static const char* id_log(msre_rule* rule) {
34+
const char* id_log(msre_rule* rule) {
3535
char* id = rule->actionset->id;
36-
if (id == NOT_SET_P || !id || !*id)
37-
id = apr_psprintf(rule->ruleset->mp, "%s (%d)", rule->filename, rule->line_num);
36+
if (!id || !*id || id == NOT_SET_P) id = apr_psprintf(rule->ruleset->mp, "%s (%d)", rule->filename, rule->line_num);
3837
return id;
3938
}
4039

apache2/msc_util.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ int ip_tree_from_uri(TreeRoot **rtree, char *uri,
166166
#endif
167167

168168
char DSOLOCAL *get_username(apr_pool_t* mp);
169+
const char* id_log(msre_rule* rule);
169170

170171
int read_line(char *buff, int size, FILE *fp);
171172

apache2/re.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,6 @@ static apr_status_t msre_rule_process(msre_rule *rule, modsec_rec *msr);
4848

4949
/* -- Actions, variables, functions and operator functions ----------------- */
5050

51-
// Returns the rule id if existing, otherwise the file name & line number
52-
static const char* id_log(msre_rule* rule) {
53-
const char* id = rule->actionset->id;
54-
if (!id || !*id || id == NOT_SET_P) id = apr_psprintf(rule->ruleset->mp, "%s (%d)", rule->filename, rule->line_num);
55-
return id;
56-
}
57-
5851
/**
5952
* \brief Remove rule targets to be processed
6053
*

configure.ac

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ AC_ARG_ENABLE(assertions,
313313
[
314314
if test "${enableval}" = "yes"; then
315315
assertions='-UNDEBUG'
316-
MODSEC_EXTRA_CFLAGS="$MODSEC_EXTRA_CFLAGS $assertions"
317316
else
318317
assertions='-DNDEBUG'
319318
fi
@@ -844,9 +843,9 @@ else
844843
EXTRA_CFLAGS="-O2 -g -Wall $strict_compile"
845844
fi
846845
fi
847-
EXTRA_CFLAGS="$EXTRA_CFLAGS $assertions"
846+
EXTRA_CFLAGS="$EXTRA_CFLAGS"
848847

849-
MODSEC_EXTRA_CFLAGS="$pcre_study $pcre_match_limit $pcre_match_limit_recursion $pcre_jit $request_early $htaccess_config $lua_cache $debug_conf $debug_cache $debug_acmp $debug_mem $perf_meas $modsec_api $cpu_type $unique_id $log_filename $log_server $log_collection_delete_problem $log_dechunk $log_stopwatch $log_handler $log_server_context $collection_global_lock $large_stream_input"
848+
MODSEC_EXTRA_CFLAGS="$pcre_study $pcre_match_limit $pcre_match_limit_recursion $pcre_jit $request_early $htaccess_config $lua_cache $debug_conf $debug_cache $debug_acmp $debug_mem $perf_meas $modsec_api $cpu_type $unique_id $log_filename $log_server $log_collection_delete_problem $log_dechunk $log_stopwatch $log_handler $log_server_context $collection_global_lock $large_stream_input $assertions"
850849

851850
APXS_WRAPPER=build/apxs-wrapper
852851
APXS_EXTRA_CFLAGS=""

0 commit comments

Comments
 (0)