From: Mark Andrews Date: Thu, 13 Sep 2018 02:39:06 +0000 (+1000) Subject: Add tests for {krb5,ms}-subdomain-self-rhs update policy rules X-Git-Tag: v9.17.20~45^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=42025548710c3514ef9b185270b259d3339e1e0f;p=thirdparty%2Fbind9.git Add tests for {krb5,ms}-subdomain-self-rhs update policy rules check that updates are accepted and rejected as expected under the following scenarios: * check krb5-subdomain-self-rhs match PTR * check krb5-subdomain-self-rhs no-match PTR * check krb5-subdomain-self-rhs match SRV * check krb5-subdomain-self-rhs no listed types match (SRV & TXT) * check krb5-subdomain-self-rhs no-match RDATA (SRV) * check krb5-subdomain-self-rhs no-match TYPE (TXT) * check krb5-subdomain-self-rhs delete PTR (matching PTR) * check krb5-subdomain-self-rhs delete PTR (matching PTR with non-matching PTR) * check krb5-subdomain-self-rhs delete ANY (matching PTR) * check krb5-subdomain-self-rhs delete ANY (matching PTR with non-matching PTR) * check krb5-subdomain-self-rhs delete SRV (matching SRV) * check krb5-subdomain-self-rhs delete SRV (matching SRV with non-matching SRV) * check krb5-subdomain-self-rhs delete ANY (matching SRV) * check krb5-subdomain-self-rhs delete ANY (matching SRV with non-matching SRV) * check ms-subdomain-self-rhs match (PTR) * check ms-subdomain-self-rhs no-match (PTR) * check ms-subdomain-self-rhs match (SRV) * check ms-subdomain-self-rhs no-match (SRV) * check ms-subdomain-self-rhs delete SRV (matching SRV) * check ms-subdomain-self-rhs delete SRV (matching SRV with non-matching SRV) * check ms-subdomain-self-rhs delete PTR (matching PTR) * check ms-subdomain-self-rhs delete PTR (matching PTR with non-matching PTR) * check ms-subdomain-self-rhs delete ANY (matching PTR) * check ms-subdomain-self-rhs delete ANY (matching PTR with non-matching PTR) * check ms-subdomain-self-rhs delete ANY (matching SRV) * check ms-subdomain-self-rhs delete ANY (matching SRV with non-matching SRV) --- diff --git a/bin/tests/system/checkconf/bad-update-policy17.conf b/bin/tests/system/checkconf/bad-update-policy17.conf new file mode 100644 index 00000000000..2951544da83 --- /dev/null +++ b/bin/tests/system/checkconf/bad-update-policy17.conf @@ -0,0 +1,18 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +zone "example.com" { + type primary; + file "example.com.db"; + update-policy { + grant realm krb5-subdomain-self-rhs PTR; + }; +}; diff --git a/bin/tests/system/checkconf/bad-update-policy18.conf b/bin/tests/system/checkconf/bad-update-policy18.conf new file mode 100644 index 00000000000..6f173b59dfb --- /dev/null +++ b/bin/tests/system/checkconf/bad-update-policy18.conf @@ -0,0 +1,18 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +zone "example.com" { + type primary; + file "example.com.db"; + update-policy { + grant realm krb5-subdomain-self-rhs SRV; + }; +}; diff --git a/bin/tests/system/checkconf/bad-update-policy19.conf b/bin/tests/system/checkconf/bad-update-policy19.conf new file mode 100644 index 00000000000..fdf862b2aa4 --- /dev/null +++ b/bin/tests/system/checkconf/bad-update-policy19.conf @@ -0,0 +1,18 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +zone "example.com" { + type primary; + file "example.com.db"; + update-policy { + grant realm ms-subdomain-self-rhs PTR; + }; +}; diff --git a/bin/tests/system/checkconf/bad-update-policy20.conf b/bin/tests/system/checkconf/bad-update-policy20.conf new file mode 100644 index 00000000000..070e3ba1768 --- /dev/null +++ b/bin/tests/system/checkconf/bad-update-policy20.conf @@ -0,0 +1,18 @@ +/* + * Copyright (C) Internet Systems Consortium, Inc. ("ISC") + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * See the COPYRIGHT file distributed with this work for additional + * information regarding copyright ownership. + */ + +zone "example.com" { + type primary; + file "example.com.db"; + update-policy { + grant realm ms-subdomain-self-rhs SRV; + }; +}; diff --git a/bin/tests/system/checkconf/tests.sh b/bin/tests/system/checkconf/tests.sh index 8f0dbadc43a..0434db77b9e 100644 --- a/bin/tests/system/checkconf/tests.sh +++ b/bin/tests/system/checkconf/tests.sh @@ -61,7 +61,7 @@ do pat="name field not set to placeholder value" grep "$pat" < checkconf.out$n > /dev/null || ret=1 ;; - bad-update-policy[67].conf|bad-update-policy1[2345].conf) + bad-update-policy[67].conf|bad-update-policy1[2345789].conf|bad-update-policy20.conf) pat="missing name field type '.*' found" grep "$pat" < checkconf.out$n > /dev/null || ret=1 ;; diff --git a/bin/tests/system/nsupdate/ns10/example.com.db.in b/bin/tests/system/nsupdate/ns10/example.com.db.in index 984274b5183..ce36901c9a2 100644 --- a/bin/tests/system/nsupdate/ns10/example.com.db.in +++ b/bin/tests/system/nsupdate/ns10/example.com.db.in @@ -17,3 +17,9 @@ $TTL 300 ; 5 minutes ) NS ns10 ns10 A 10.53.0.10 +single.any.self-srv SRV 0 0 0 machine.example.com. +many.any.self-srv SRV 0 0 0 machine.example.com. +many.any.self-srv SRV 0 0 0 notmachine.example.com. +single.srv.self-srv SRV 0 0 0 machine.example.com. +many.srv.self-srv SRV 0 0 0 machine.example.com. +many.srv.self-srv SRV 0 0 0 notmachine.example.com. diff --git a/bin/tests/system/nsupdate/ns10/in-addr.db.in b/bin/tests/system/nsupdate/ns10/in-addr.db.in index 984274b5183..d751ea033ca 100644 --- a/bin/tests/system/nsupdate/ns10/in-addr.db.in +++ b/bin/tests/system/nsupdate/ns10/in-addr.db.in @@ -17,3 +17,9 @@ $TTL 300 ; 5 minutes ) NS ns10 ns10 A 10.53.0.10 +single.any.self-ptr PTR machine.example.com. +many.any.self-ptr PTR machine.example.com. +many.any.self-ptr PTR notmachine.example.com. +single.ptr.self-ptr PTR machine.example.com. +many.ptr.self-ptr PTR machine.example.com. +many.ptr.self-ptr PTR notmachine.example.com. diff --git a/bin/tests/system/nsupdate/ns10/named.conf.in b/bin/tests/system/nsupdate/ns10/named.conf.in index 28fa5b5a295..f87e4821726 100644 --- a/bin/tests/system/nsupdate/ns10/named.conf.in +++ b/bin/tests/system/nsupdate/ns10/named.conf.in @@ -35,7 +35,7 @@ controls { zone "in-addr.arpa" { type primary; file "in-addr.db"; - update-policy { grant EXAMPLE.COM ms-subdomain . PTR; }; + update-policy { grant EXAMPLE.COM ms-subdomain-self-rhs . PTR; }; }; zone "example.com" { @@ -44,5 +44,6 @@ zone "example.com" { update-policy { grant EXAMPLE.COM ms-selfsub . ANY; grant EXAMPLE.COM ms-subdomain _tcp.example.com SRV; + grant EXAMPLE.COM ms-subdomain-self-rhs self-srv.example.com SRV; }; }; diff --git a/bin/tests/system/nsupdate/ns7/example.com.db.in b/bin/tests/system/nsupdate/ns7/example.com.db.in index c327325f916..be966d1e452 100644 --- a/bin/tests/system/nsupdate/ns7/example.com.db.in +++ b/bin/tests/system/nsupdate/ns7/example.com.db.in @@ -17,3 +17,9 @@ $TTL 300 ; 5 minutes ) NS ns7 ns7 A 10.53.0.7 +single.any.self-srv SRV 0 0 0 machine.example.com. +many.any.self-srv SRV 0 0 0 machine.example.com. +many.any.self-srv SRV 0 0 0 notmachine.example.com. +single.srv.self-srv SRV 0 0 0 machine.example.com. +many.srv.self-srv SRV 0 0 0 machine.example.com. +many.srv.self-srv SRV 0 0 0 notmachine.example.com. diff --git a/bin/tests/system/nsupdate/ns7/in-addr.db.in b/bin/tests/system/nsupdate/ns7/in-addr.db.in index c327325f916..bcbc8fcdd55 100644 --- a/bin/tests/system/nsupdate/ns7/in-addr.db.in +++ b/bin/tests/system/nsupdate/ns7/in-addr.db.in @@ -17,3 +17,9 @@ $TTL 300 ; 5 minutes ) NS ns7 ns7 A 10.53.0.7 +single.any.self-ptr PTR machine.example.com. +many.any.self-ptr PTR machine.example.com. +many.any.self-ptr PTR notmachine.example.com. +single.ptr.self-ptr PTR machine.example.com. +many.ptr.self-ptr PTR machine.example.com. +many.ptr.self-ptr PTR notmachine.example.com. diff --git a/bin/tests/system/nsupdate/ns7/named.conf.in b/bin/tests/system/nsupdate/ns7/named.conf.in index 49a3e3b08b5..b24cbfa9d8f 100644 --- a/bin/tests/system/nsupdate/ns7/named.conf.in +++ b/bin/tests/system/nsupdate/ns7/named.conf.in @@ -35,7 +35,7 @@ controls { zone "in-addr.arpa" { type primary; file "in-addr.db"; - update-policy { grant EXAMPLE.COM krb5-subdomain . PTR; }; + update-policy { grant EXAMPLE.COM krb5-subdomain-self-rhs . PTR; }; }; zone "example.com" { @@ -44,5 +44,7 @@ zone "example.com" { update-policy { grant EXAMPLE.COM krb5-self . ANY; grant EXAMPLE.COM krb5-subdomain _tcp.example.com SRV; + grant EXAMPLE.COM krb5-subdomain-self-rhs self-srv.example.com SRV; + grant EXAMPLE.COM krb5-subdomain-self-rhs self-srv-no-type.example.com; }; }; diff --git a/bin/tests/system/nsupdate/tests.sh b/bin/tests/system/nsupdate/tests.sh index ac4ce7eaf83..88910f95a34 100755 --- a/bin/tests/system/nsupdate/tests.sh +++ b/bin/tests/system/nsupdate/tests.sh @@ -1409,6 +1409,272 @@ EOF grep "status: NXDOMAIN" dig.out.ns7.test$n > /dev/null || ret=1 [ $ret = 0 ] || { echo_i "failed"; status=1; } + n=$((n+1)) + ret=0 + echo_i "check krb5-subdomain-self-rhs match PTR ($n)" + KRB5CCNAME="FILE:"`pwd`/ns7/machine.ccache + export KRB5CCNAME + $NSUPDATE -d << EOF > nsupdate.out-$n 2>&1 || ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.7 ${PORT} + zone in-addr.arpa + update add 4.3.2.1.in-addr.arpa 3600 IN PTR machine.example.com + send +EOF + $DIG $DIGOPTS +tcp @10.53.0.7 4.3.2.1.in-addr.arpa PTR > dig.out.ns7.test$n + grep "status: NOERROR" dig.out.ns7.test$n > /dev/null || ret=1 + grep "4.3.2.1.in-addr.arpa.*PTR.*machine.example.com" dig.out.ns7.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check krb5-subdomain-self-rhs no-match PTR ($n)" + KRB5CCNAME="FILE:"`pwd`/ns7/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 && ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.7 ${PORT} + zone in-addr.arpa + update add 5.3.2.1.in-addr.arpa 3600 IN PTR notme.example.com + send +EOF + grep "update failed: REFUSED" nsupdate.out-$n > /dev/null || ret=1 + $DIG $DIGOPTS +tcp @10.53.0.7 5.3.2.1.in-addr.arpa PTR > dig.out.ns7.test$n + grep "status: NXDOMAIN" dig.out.ns7.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check krb5-subdomain-self-rhs match SRV ($n)" + KRB5CCNAME="FILE:"`pwd`/ns7/machine.ccache + export KRB5CCNAME + $NSUPDATE -d << EOF > nsupdate.out-$n 2>&1 || ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.7 ${PORT} + zone example.com + update add _xxx.self-srv.example.com 3600 IN SRV 0 0 0 machine.example.com + send +EOF + $DIG $DIGOPTS +tcp @10.53.0.7 _xxx.self-srv.example.com ANY > dig.out.ns7.test$n + grep "status: NOERROR" dig.out.ns7.test$n > /dev/null || ret=1 + grep "_xxx.self-srv.example.com.*SRV.*0 0 0 machine.example.com" dig.out.ns7.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check krb5-subdomain-self-rhs no listed types match (SRV & TXT) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns7/machine.ccache + export KRB5CCNAME + $NSUPDATE -d << EOF > nsupdate.out-$n 2>&1 || ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.7 ${PORT} + zone example.com + update add _xxx.self-srv-no-type.example.com 3600 IN SRV 0 0 0 machine.example.com + update add _xxx.self-srv-no-type.example.com 3600 IN TXT a txt record + send +EOF + $DIG $DIGOPTS +tcp @10.53.0.7 _xxx.self-srv-no-type.example.com ANY > dig.out.ns7.test$n + grep "status: NOERROR" dig.out.ns7.test$n > /dev/null || ret=1 + grep '_xxx.self-srv-no-type.example.com.*SRV.*0 0 0 machine.example.com' dig.out.ns7.test$n > /dev/null || ret=1 + grep '_xxx.self-srv-no-type.example.com.*TXT.*"a" "txt" "record"' dig.out.ns7.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check krb5-subdomain-self-rhs no-match RDATA (SRV) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns7/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 && ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.7 ${PORT} + zone example.com + update add _yyy.self-srv.example.com 3600 IN SRV 0 0 0 notme.example.com + send +EOF + grep "update failed: REFUSED" nsupdate.out-$n > /dev/null || ret=1 + $DIG $DIGOPTS +tcp @10.53.0.7 _yyy.self-srv.example.com SRV > dig.out.ns7.test$n + grep "status: NXDOMAIN" dig.out.ns7.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check krb5-subdomain-self-rhs no-match TYPE (TXT) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns7/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 && ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.7 ${PORT} + zone example.com + update add _yyy.self-srv.example.com 3600 IN TXT a-txt-record + send +EOF + grep "update failed: REFUSED" nsupdate.out-$n > /dev/null || ret=1 + $DIG $DIGOPTS +tcp @10.53.0.7 _yyy.self-srv.example.com TXT > dig.out.ns7.test$n + grep "status: NXDOMAIN" dig.out.ns7.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check krb5-subdomain-self-rhs delete PTR (matching PTR) ($n)" + $DIG $DIGOPTS +tcp @10.53.0.7 single.ptr.self-ptr.in-addr.arpa PTR > dig.out.ns7.pre.test$n + grep "status: NOERROR" dig.out.ns7.pre.test$n > /dev/null || ret=1 + grep "ANSWER: 1," dig.out.ns7.pre.test$n > /dev/null || ret=1 + KRB5CCNAME="FILE:"`pwd`/ns7/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 || ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.7 ${PORT} + zone in-addr.arpa + update delete single.ptr.self-ptr.in-addr.arpa PTR + send +EOF + $DIG $DIGOPTS +tcp @10.53.0.7 single.ptr.self-ptr.in-addr.arpa PTR > dig.out.ns7.test$n + grep "status: NXDOMAIN" dig.out.ns7.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check krb5-subdomain-self-rhs delete PTR (matching PTR with non-matching PTR) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns7/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 && ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.7 ${PORT} + zone in-addr.arpa + update delete many.ptr.self-ptr.in-addr.arpa PTR + send +EOF + grep "update failed: REFUSED" nsupdate.out-$n > /dev/null || ret=1 + $DIG $DIGOPTS +tcp @10.53.0.7 many.ptr.self-ptr.in-addr.arpa PTR > dig.out.ns7.test$n + grep "status: NOERROR" dig.out.ns7.test$n > /dev/null || ret=1 + grep "ANSWER: 2," dig.out.ns7.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check krb5-subdomain-self-rhs delete ANY (matching PTR) ($n)" + $DIG $DIGOPTS +tcp @10.53.0.7 single.any.self-ptr.in-addr.arpa PTR > dig.out.ns7.pre.test$n + grep "status: NOERROR" dig.out.ns7.pre.test$n > /dev/null || ret=1 + grep "ANSWER: 1," dig.out.ns7.pre.test$n > /dev/null || ret=1 + KRB5CCNAME="FILE:"`pwd`/ns7/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 || ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.7 ${PORT} + zone in-addr.arpa + update delete single.any.self-ptr.in-addr.arpa + send +EOF + $DIG $DIGOPTS +tcp @10.53.0.7 single.any.self-ptr.in-addr.arpa PTR > dig.out.ns7.test$n + grep "status: NXDOMAIN" dig.out.ns7.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check krb5-subdomain-self-rhs delete ANY (matching PTR with non-matching PTR) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns7/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 && ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.7 ${PORT} + zone in-addr.arpa + update delete many.any.self-ptr.in-addr.arpa + send +EOF + grep "update failed: REFUSED" nsupdate.out-$n > /dev/null || ret=1 + $DIG $DIGOPTS +tcp @10.53.0.7 many.any.self-ptr.in-addr.arpa PTR > dig.out.ns7.test$n + grep "status: NOERROR" dig.out.ns7.test$n > /dev/null || ret=1 + grep "ANSWER: 2," dig.out.ns7.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check krb5-subdomain-self-rhs delete SRV (matching SRV) ($n)" + $DIG $DIGOPTS +tcp @10.53.0.7 single.srv.self-srv.example.com SRV > dig.out.ns7.pre.test$n + grep "status: NOERROR" dig.out.ns7.pre.test$n > /dev/null || ret=1 + grep "ANSWER: 1," dig.out.ns7.pre.test$n > /dev/null || ret=1 + KRB5CCNAME="FILE:"`pwd`/ns7/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 || ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.7 ${PORT} + zone example.com + update delete single.srv.self-srv.example.com SRV + send +EOF + $DIG $DIGOPTS +tcp @10.53.0.7 single.srv.self-srv.example.com SRV > dig.out.ns7.test$n + grep "status: NXDOMAIN" dig.out.ns7.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check krb5-subdomain-self-rhs delete SRV (matching SRV with non-matching SRV) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns7/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 && ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.7 ${PORT} + zone example.com + update delete many.srv.self-srv.example.com SRV + send +EOF + grep "update failed: REFUSED" nsupdate.out-$n > /dev/null || ret=1 + $DIG $DIGOPTS +tcp @10.53.0.7 many.srv.self-srv.example.com SRV > dig.out.ns7.test$n + grep "status: NOERROR" dig.out.ns7.test$n > /dev/null || ret=1 + grep "ANSWER: 2," dig.out.ns7.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check krb5-subdomain-self-rhs delete ANY (matching SRV) ($n)" + $DIG $DIGOPTS +tcp @10.53.0.7 single.any.self-srv.example.com SRV > dig.out.ns7.pre.test$n + grep "status: NOERROR" dig.out.ns7.pre.test$n > /dev/null || ret=1 + grep "ANSWER: 1," dig.out.ns7.pre.test$n > /dev/null || ret=1 + KRB5CCNAME="FILE:"`pwd`/ns7/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 || ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.7 ${PORT} + zone example.com + update delete single.any.self-srv.example.com + send +EOF + $DIG $DIGOPTS +tcp @10.53.0.7 single.any.self-srv.example.com SRV > dig.out.ns7.test$n + grep "status: NXDOMAIN" dig.out.ns7.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check krb5-subdomain-self-rhs delete ANY (matching SRV with non-matching SRV) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns7/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 && ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.7 ${PORT} + zone example.com + update delete many.any.self-srv.example.com + send +EOF + grep "update failed: REFUSED" nsupdate.out-$n > /dev/null || ret=1 + $DIG $DIGOPTS +tcp @10.53.0.7 many.any.self-srv.example.com SRV > dig.out.ns7.test$n + grep "status: NOERROR" dig.out.ns7.test$n > /dev/null || ret=1 + grep "ANSWER: 2," dig.out.ns7.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + n=`expr $n + 1` ret=0 echo_i "check krb5-selfsub match ($n)" @@ -1447,7 +1713,6 @@ EOF n=`expr $n + 1` ret=0 - echo_i "check ms-self match ($n)" KRB5CCNAME="FILE:"`pwd`/ns9/machine.ccache export KRB5CCNAME @@ -1518,6 +1783,234 @@ EOF grep "status: NXDOMAIN" dig.out.ns9.test$n > /dev/null || ret=1 [ $ret = 0 ] || { echo_i "failed"; status=1; } + n=$((n+1)) + ret=0 + echo_i "check ms-subdomain-self-rhs match (PTR) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns10/machine.ccache + export KRB5CCNAME + $NSUPDATE -d << EOF > nsupdate.out-$n 2>&1 || ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.10 ${PORT} + zone in-addr.arpa + update add 4.3.2.1.in-addr.arpa 3600 IN PTR machine.example.com + send +EOF + $DIG $DIGOPTS +tcp @10.53.0.10 4.3.2.1.in-addr.arpa PTR > dig.out.ns10.test$n + grep "status: NOERROR" dig.out.ns10.test$n > /dev/null || ret=1 + grep "4.3.2.1.in-addr.arpa.*PTR.*machine.example.com" dig.out.ns10.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check ms-subdomain-self-rhs no-match (PTR) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns10/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 && ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.10 ${PORT} + zone in-addr.arpa + update add 5.3.2.1.in-addr.arpa 3600 IN PTR notme.example.com + send +EOF + grep "update failed: REFUSED" nsupdate.out-$n > /dev/null || ret=1 + $DIG $DIGOPTS +tcp @10.53.0.10 5.3.2.1.in-addr.arpa PTR > dig.out.ns10.test$n + grep "status: NXDOMAIN" dig.out.ns10.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check ms-subdomain-self-rhs match (SRV) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns10/machine.ccache + export KRB5CCNAME + $NSUPDATE -d << EOF > nsupdate.out-$n 2>&1 || ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.10 ${PORT} + zone example.com + update add _xxx.self-srv.example.com 3600 IN SRV 0 0 0 machine.example.com + send +EOF + $DIG $DIGOPTS +tcp @10.53.0.10 _xxx.self-srv.example.com SRV > dig.out.ns10.test$n + grep "status: NOERROR" dig.out.ns10.test$n > /dev/null || ret=1 + grep "_xxx.self-srv.example.com.*SRV.*0 0 0 machine.example.com" dig.out.ns10.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check ms-subdomain-self-rhs no-match (SRV) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns10/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 && ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.10 ${PORT} + zone example.com + update add _yyy.self-srv.example.com 3600 IN SRV 0 0 0 notme.example.com + send +EOF + grep "update failed: REFUSED" nsupdate.out-$n > /dev/null || ret=1 + $DIG $DIGOPTS +tcp @10.53.0.10 _yyy.self-srv.example.com SRV > dig.out.ns10.test$n + grep "status: NXDOMAIN" dig.out.ns10.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check ms-subdomain-self-rhs delete SRV (matching SRV) ($n)" + $DIG $DIGOPTS +tcp @10.53.0.10 single.srv.self-srv.example.com SRV > dig.out.ns10.pre.test$n + grep "status: NOERROR" dig.out.ns10.pre.test$n > /dev/null || ret=1 + grep "ANSWER: 1," dig.out.ns10.pre.test$n > /dev/null || ret=1 + KRB5CCNAME="FILE:"`pwd`/ns10/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 || ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.10 ${PORT} + zone example.com + update delete single.srv.self-srv.example.com SRV + send +EOF + $DIG $DIGOPTS +tcp @10.53.0.10 single.srv.self-srv.example.com SRV > dig.out.ns10.test$n + grep "status: NXDOMAIN" dig.out.ns10.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check ms-subdomain-self-rhs delete SRV (matching SRV with non-matching SRV) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns10/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 && ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.10 ${PORT} + zone example.com + update delete many.srv.self-srv.example.com SRV + send +EOF + grep "update failed: REFUSED" nsupdate.out-$n > /dev/null || ret=1 + $DIG $DIGOPTS +tcp @10.53.0.10 many.srv.self-srv.example.com SRV > dig.out.ns10.test$n + grep "status: NOERROR" dig.out.ns10.test$n > /dev/null || ret=1 + grep "ANSWER: 2," dig.out.ns10.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check ms-subdomain-self-rhs delete PTR (matching PTR) ($n)" + $DIG $DIGOPTS +tcp @10.53.0.10 single.ptr.self-ptr.in-addr.arpa PTR > dig.out.ns10.pre.test$n + grep "status: NOERROR" dig.out.ns10.pre.test$n > /dev/null || ret=1 + grep "ANSWER: 1," dig.out.ns10.pre.test$n > /dev/null || ret=1 + KRB5CCNAME="FILE:"`pwd`/ns10/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 || ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.10 ${PORT} + zone in-addr.arpa + update delete single.ptr.self-ptr.in-addr.arpa PTR + send +EOF + $DIG $DIGOPTS +tcp @10.53.0.10 single.ptr.self-ptr.in-addr.arpa PTR > dig.out.ns10.test$n + grep "status: NXDOMAIN" dig.out.ns10.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check ms-subdomain-self-rhs delete PTR (matching PTR with non-matching PTR) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns10/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 && ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.10 ${PORT} + zone in-addr.arpa + update delete many.ptr.self-ptr.in-addr.arpa PTR + send +EOF + grep "update failed: REFUSED" nsupdate.out-$n > /dev/null || ret=1 + $DIG $DIGOPTS +tcp @10.53.0.10 many.ptr.self-ptr.in-addr.arpa PTR > dig.out.ns10.test$n + grep "status: NOERROR" dig.out.ns10.test$n > /dev/null || ret=1 + grep "ANSWER: 2," dig.out.ns10.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check ms-subdomain-self-rhs delete ANY (matching PTR) ($n)" + $DIG $DIGOPTS +tcp @10.53.0.10 single.any.self-ptr.in-addr.arpa PTR > dig.out.ns10.pre.test$n + grep "status: NOERROR" dig.out.ns10.pre.test$n > /dev/null || ret=1 + grep "ANSWER: 1," dig.out.ns10.pre.test$n > /dev/null || ret=1 + KRB5CCNAME="FILE:"`pwd`/ns10/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 || ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.10 ${PORT} + zone in-addr.arpa + update delete single.any.self-ptr.in-addr.arpa + send +EOF + $DIG $DIGOPTS +tcp @10.53.0.10 single.any.self-ptr.in-addr.arpa PTR > dig.out.ns10.test$n + grep "status: NXDOMAIN" dig.out.ns10.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check ms-subdomain-self-rhs delete ANY (matching PTR with non-matching PTR) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns10/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 && ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.10 ${PORT} + zone in-addr.arpa + update delete many.any.self-ptr.in-addr.arpa + send +EOF + grep "update failed: REFUSED" nsupdate.out-$n > /dev/null || ret=1 + $DIG $DIGOPTS +tcp @10.53.0.10 many.any.self-ptr.in-addr.arpa PTR > dig.out.ns10.test$n + grep "status: NOERROR" dig.out.ns10.test$n > /dev/null || ret=1 + grep "ANSWER: 2," dig.out.ns10.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check ms-subdomain-self-rhs delete ANY (matching SRV) ($n)" + $DIG $DIGOPTS +tcp @10.53.0.10 single.any.self-srv.example.com SRV > dig.out.ns10.pre.test$n + grep "status: NOERROR" dig.out.ns10.pre.test$n > /dev/null || ret=1 + grep "ANSWER: 1," dig.out.ns10.pre.test$n > /dev/null || ret=1 + KRB5CCNAME="FILE:"`pwd`/ns10/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 || ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.10 ${PORT} + zone example.com + update delete single.any.self-srv.example.com + send +EOF + $DIG $DIGOPTS +tcp @10.53.0.10 single.any.self-srv.example.com SRV > dig.out.ns10.test$n + grep "status: NXDOMAIN" dig.out.ns10.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + + n=$((n+1)) + ret=0 + echo_i "check ms-subdomain-self-rhs delete ANY (matching SRV with non-matching SRV) ($n)" + KRB5CCNAME="FILE:"`pwd`/ns10/machine.ccache + export KRB5CCNAME + $NSUPDATE << EOF > nsupdate.out-$n 2>&1 && ret=1 + gsstsig + realm EXAMPLE.COM + server 10.53.0.10 ${PORT} + zone example.com + update delete many.any.self-srv.example.com + send +EOF + grep "update failed: REFUSED" nsupdate.out-$n > /dev/null || ret=1 + $DIG $DIGOPTS +tcp @10.53.0.10 many.any.self-srv.example.com SRV > dig.out.ns10.test$n + grep "status: NOERROR" dig.out.ns10.test$n > /dev/null || ret=1 + grep "ANSWER: 2," dig.out.ns10.test$n > /dev/null || ret=1 + [ $ret = 0 ] || { echo_i "failed"; status=1; } + n=`expr $n + 1` ret=0 echo_i "check ms-selfsub match ($n)"