mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-16 07:56:12 +03:00
nginx: looking for segfaults on the regression test.
If nginx segfaults it will return, warning that the test failed.
This commit is contained in:
parent
9602fa4a44
commit
0b5f3e123c
@ -204,6 +204,16 @@ sub runfile {
|
||||
my $rc = 0;
|
||||
my $conf_fn;
|
||||
|
||||
# watch for segfaults
|
||||
if ($t and !$t->{match_log}) {
|
||||
$t->{match_log} = {};
|
||||
}
|
||||
if ($t and $t->{match_log} and !$t->{match_log}{-error}) {
|
||||
$t->{match_log}{-error} = [];
|
||||
}
|
||||
push $t->{match_log}{-error}, qr/(core dump)/;
|
||||
push $t->{match_log}{-error}, 1;
|
||||
|
||||
# Startup nginx with optionally included conf.
|
||||
if (exists $t{conf} and defined $t{conf}) {
|
||||
$conf_fn = sprintf "%s/%s_%s_%06d.conf",
|
||||
@ -498,7 +508,6 @@ READ: {
|
||||
#dbg("Match \"$re\" in $name \"$$rbuf\" ($n)");
|
||||
if ($$rbuf =~ m/$re/m) {
|
||||
$rc = $&;
|
||||
# print "bonga\n";
|
||||
last;
|
||||
}
|
||||
# TODO: Use select()/poll()
|
||||
@ -695,6 +704,7 @@ sub nginx_reset_fd {
|
||||
return undef;
|
||||
}
|
||||
|
||||
|
||||
# Any extras listed in "match_log"
|
||||
if ($t and exists $t->{match_log}) {
|
||||
for my $k (keys %{ $t->{match_log} || {} }) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user