- Add testcase for allowing NOTIFY on URL addresses.

This commit is contained in:
George Thessalonikefs 2022-06-14 17:44:37 +02:00
parent 16dd802c2e
commit 187bc72633
3 changed files with 23 additions and 1 deletions

View File

@ -5512,7 +5512,7 @@ xfr_transfer_init_fetch(struct auth_xfer* xfr, struct module_env* env)
addr_to_str(&addr, addrlen, as, sizeof(as));
verbose(VERB_ALGO, "auth zone %s transfer next HTTP fetch from %s started", zname, as);
}
/* Create or refresh the list of of allow_notify addrs */
/* Create or refresh the list of allow_notify addrs */
probe_copy_masters_for_allow_notify(xfr);
return 1;
}

View File

@ -5,6 +5,7 @@
[ -f .tpkg.var.test ] && source .tpkg.var.test
PRE="../.."
. ../common.sh
# do the test
echo "> dig www.example.com."
dig @localhost -p $UNBOUND_PORT www.example.com. | tee outfile
@ -48,4 +49,15 @@ else
exit 1
fi
# Test that notify is allowed from the webserver address
get_ldns_notify
echo "> ldns-notify -z example.com"
$LDNS_NOTIFY -p $UNBOUND_PORT -z example.com 127.0.0.1 | tee outfile
if grep "rcode: REFUSED" outfile; then
echo "Not OK"
exit 1
else
echo "OK"
fi
exit 0

10
testdata/common.sh vendored
View File

@ -14,6 +14,7 @@
# info x : print info
# test_tool_avail x : see if program in path and complain, exit if not.
# get_ldns_testns : set LDNS_TESTNS to executable ldns-testns
# get_ldns_notify : set LDNS_NOTIFY to executable ldns-notify
# get_make : set MAKE to gmake or make tool.
# get_gcc : set cc or gcc in CC
# get_pcat : set PCAT, PCAT_DIFF and PCAT_PRINT executables.
@ -62,6 +63,15 @@ get_ldns_testns () {
fi
}
# get ldns-notify tool in LDNS_NOTIFY variable.
get_ldns_notify () {
if test -x "`which ldns-notify 2>&1`"; then
LDNS_NOTIFY=ldns-notify
else
LDNS_NOTIFY=/home/wouter/bin/ldns-notify
fi
}
# get make tool in MAKE variable, gmake is used if present.
get_make () {
if test -x "`which gmake 2>&1`"; then