mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Merge pull request #3265 from rainerjung/v2/move-id_log-to-msc_util
Move id_log() to msc_util to fix unit tests; it is declared on msc_ut…
This commit is contained in:
commit
d6f1ebb4a3
@ -30,16 +30,6 @@
|
||||
APLOG_USE_MODULE(security2);
|
||||
#endif
|
||||
|
||||
// Returns the rule id if existing, otherwise the file name & line number
|
||||
const char* id_log(msre_rule* rule) {
|
||||
assert(rule != NULL);
|
||||
assert(rule->actionset != NULL);
|
||||
assert(rule->ruleset != NULL);
|
||||
const char* id = rule->actionset->id;
|
||||
if (!id || id == NOT_SET_P || !*id) id = apr_psprintf(rule->ruleset->mp, "%s (%d)", rule->filename, rule->line_num);
|
||||
return id;
|
||||
}
|
||||
|
||||
/* -- Directory context creation and initialisation -- */
|
||||
|
||||
/**
|
||||
|
@ -2849,3 +2849,13 @@ char* get_username(apr_pool_t* mp) {
|
||||
if (rc != APR_SUCCESS) return "apache";
|
||||
return username;
|
||||
}
|
||||
|
||||
// Returns the rule id if existing, otherwise the file name & line number
|
||||
const char* id_log(msre_rule* rule) {
|
||||
assert(rule != NULL);
|
||||
assert(rule->actionset != NULL);
|
||||
assert(rule->ruleset != NULL);
|
||||
const char* id = rule->actionset->id;
|
||||
if (!id || id == NOT_SET_P || !*id) id = apr_psprintf(rule->ruleset->mp, "%s (%d)", rule->filename, rule->line_num);
|
||||
return id;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user