Added a check that SecServerSignature actually worked (Apache changed some of this code as of 2.2.4 and could potentially change it again and break this).

Cleaned up some configure code.
Cleaned up some extraneous cache logging.
Cleaned up the output from the test script.
This commit is contained in:
brectanus 2008-01-14 22:32:53 +00:00
parent fabeaf5059
commit 99c41afc3d
5 changed files with 21 additions and 9 deletions

View File

@ -57,7 +57,7 @@ install: install-mods
clean-extras:
@for dir in mlogc-src; do \
test -e $$dir && $(MAKE) -C $$dir clean; \
done;
done; \
rm -rf mlogc mlogc-static
clean: clean-extras
@ -89,7 +89,7 @@ TESTOBJS = re.o re_operators.o re_actions.o re_tfns.o re_variables.o \
msc_reqbody.o msc_geo.o acmp.o msc_lua.o
msc_test: mod_security2.la msc_test.c
$(CC) $(CPPFLAGS) $(LDFLAGS) $(APXS_INCLUDES) $(EXTRA_CFLAGS) $(MODSEC_EXTRA_CFLAGS) $(APR_CFLAGS) $(APU_CFLAGS) -o msc_test $(TESTOBJS) msc_test.c $(LIBS) $(APR_LIBS) $(APU_LIBS) $(APXS_LIBS) $(APR_LINK_LD) $(APU_LINK_LD)
@$(CC) $(CPPFLAGS) $(LDFLAGS) $(APXS_INCLUDES) $(EXTRA_CFLAGS) $(MODSEC_EXTRA_CFLAGS) $(APR_CFLAGS) $(APU_CFLAGS) -o msc_test $(TESTOBJS) msc_test.c $(LIBS) $(APR_LIBS) $(APU_LIBS) $(APXS_LIBS) $(APR_LINK_LD) $(APU_LINK_LD)
test: msc_test
@t/run-tests.pl

View File

@ -51,11 +51,14 @@ AC_ARG_WITH(apxs,
])
if test -z "$APXS"; then
for i in /usr/sbin \
/usr/local/apache22/bin \
for i in /usr/local/apache22/bin \
/usr/local/apache2/bin \
/usr/local/apache/bin \
/usr/local/sbin ; do
/usr/local/sbin \
/usr/local/bin \
/usr/sbin \
/usr/bin;
do
if test -f "$i/apxs2"; then
APXS="$i/apxs2"
break

View File

@ -392,6 +392,18 @@ static apr_status_t change_server_signature(server_rec *s) {
return -1;
}
/* Check that it really changed. This assumes that what we got was
* not a copy and this could change in future versions of Apache.
*/
server_version = (char *)apache_get_server_version();
if ((server_version == NULL) || (strcmp(server_version, new_server_signature) != 0)) {
ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, s, "SecServerSignature: Failed to change server signature to \"%s\".", new_server_signature);
return 0;
}
else {
ap_log_error(APLOG_MARK, APLOG_DEBUG | APLOG_NOERRNO, 0, s, "SecServerSignature: Changed server signature to \"%s\".", server_version);
}
return 1;
}

View File

@ -1695,9 +1695,6 @@ static apr_status_t msre_rule_process_normal(msre_rule *rule, modsec_rec *msr) {
}
}
}
else {
msr_log(msr, 9, "CACHE: Disabled");
}
#if !defined(PERFORMANCE_MEASUREMENT)
if (msr->txcfg->debuglog_level >= 4)

View File

@ -115,7 +115,7 @@ sub runfile {
$TOTAL += $testnum ? 1 : $n;
$PASSED += $pass;
msg(sprintf("Passed: %2d; Failed %2d", $pass, $testnum ? (1 - $pass) : ($n - $pass)));
msg(sprintf("Passed: %2d; Failed: %2d", $pass, $testnum ? (1 - $pass) : ($n - $pass)));
}
sub escape {