mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 06:55:30 +00:00
3908. [bug] rndc now differentiates between a zone in multiple
views and a zone that doesn't exist at all. [RT #36691]
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
|||||||
|
3908. [bug] rndc now differentiates between a zone in multiple
|
||||||
|
views and a zone that doesn't exist at all. [RT #36691]
|
||||||
|
|
||||||
3907. [cleanup] Alphabetise rndc help. [RT#36683]
|
3907. [cleanup] Alphabetise rndc help. [RT#36683]
|
||||||
|
|
||||||
3906. [protocol] Update URI record format to comply with
|
3906. [protocol] Update URI record format to comply with
|
||||||
|
@@ -7149,6 +7149,10 @@ zone_from_args(ns_server_t *server, char *args, const char *zonetxt,
|
|||||||
snprintf(problem, sizeof(problem),
|
snprintf(problem, sizeof(problem),
|
||||||
"no matching zone '%s' in any view",
|
"no matching zone '%s' in any view",
|
||||||
zonetxt);
|
zonetxt);
|
||||||
|
else if (result == ISC_R_MULTIPLE)
|
||||||
|
snprintf(problem, sizeof(problem),
|
||||||
|
"zone '%s' was found in multiple views",
|
||||||
|
zonetxt);
|
||||||
} else {
|
} else {
|
||||||
result = dns_viewlist_find(&server->viewlist, viewtxt,
|
result = dns_viewlist_find(&server->viewlist, viewtxt,
|
||||||
rdclass, &view);
|
rdclass, &view);
|
||||||
|
@@ -14,8 +14,6 @@
|
|||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: named.conf,v 1.3 2012/01/31 23:47:32 tbox Exp $ */
|
|
||||||
|
|
||||||
// NS1
|
// NS1
|
||||||
|
|
||||||
controls { /* empty */ };
|
controls { /* empty */ };
|
||||||
@@ -43,15 +41,33 @@ controls {
|
|||||||
inet 10.53.0.1 port 9953 allow { any; } keys { rndc_key; };
|
inet 10.53.0.1 port 9953 allow { any; } keys { rndc_key; };
|
||||||
};
|
};
|
||||||
|
|
||||||
zone "master.example" {
|
view unused {
|
||||||
type master;
|
match-clients { none; };
|
||||||
file "master.db";
|
|
||||||
allow-update { any; };
|
zone "duplicate.example" {
|
||||||
allow-transfer { any; };
|
type master;
|
||||||
auto-dnssec maintain;
|
file "duplicate.db";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
zone "reload.example" {
|
view primary {
|
||||||
type master;
|
match-clients { any; };
|
||||||
file "reload.db";
|
|
||||||
|
zone "master.example" {
|
||||||
|
type master;
|
||||||
|
file "master.db";
|
||||||
|
allow-update { any; };
|
||||||
|
allow-transfer { any; };
|
||||||
|
auto-dnssec maintain;
|
||||||
|
};
|
||||||
|
|
||||||
|
zone "reload.example" {
|
||||||
|
type master;
|
||||||
|
file "reload.db";
|
||||||
|
};
|
||||||
|
|
||||||
|
zone "duplicate.example" {
|
||||||
|
type master;
|
||||||
|
file "duplicate.db";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
@@ -22,6 +22,7 @@ $SHELL clean.sh
|
|||||||
test -r $RANDFILE || $GENRANDOM 400 $RANDFILE
|
test -r $RANDFILE || $GENRANDOM 400 $RANDFILE
|
||||||
|
|
||||||
$SHELL ../genzone.sh 1 > ns1/master.db
|
$SHELL ../genzone.sh 1 > ns1/master.db
|
||||||
|
$SHELL ../genzone.sh 1 > ns1/duplicate.db
|
||||||
cd ns1
|
cd ns1
|
||||||
touch master.db.signed
|
touch master.db.signed
|
||||||
echo '$INCLUDE "master.db.signed"' >> master.db
|
echo '$INCLUDE "master.db.signed"' >> master.db
|
||||||
|
@@ -14,8 +14,6 @@
|
|||||||
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
# PERFORMANCE OF THIS SOFTWARE.
|
# PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
# $Id: tests.sh,v 1.10 2012/02/02 03:26:55 marka Exp $
|
|
||||||
|
|
||||||
SYSTEMTESTTOP=..
|
SYSTEMTESTTOP=..
|
||||||
. $SYSTEMTESTTOP/conf.sh
|
. $SYSTEMTESTTOP/conf.sh
|
||||||
|
|
||||||
@@ -237,5 +235,16 @@ checkfor "files: reload.db$" rndc.out.removeinclude
|
|||||||
if [ $ret != 0 ]; then echo "I:failed"; fi
|
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||||
status=`expr $status + $ret`
|
status=`expr $status + $ret`
|
||||||
|
|
||||||
|
echo "I: checking 'rdnc zonestatus' with duplicated zone name"
|
||||||
|
ret=0
|
||||||
|
$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus duplicate.example > rndc.out.duplicate 2>&1
|
||||||
|
checkfor "zone 'duplicate.example' was found in multiple views" rndc.out.duplicate
|
||||||
|
$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus duplicate.example in primary > rndc.out.duplicate 2>&1
|
||||||
|
checkfor "name: duplicate.example" rndc.out.duplicate
|
||||||
|
$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 zonestatus nosuchzone.example > rndc.out.duplicate 2>&1
|
||||||
|
checkfor "no matching zone 'nosuchzone.example' in any view" rndc.out.duplicate
|
||||||
|
if [ $ret != 0 ]; then echo "I:failed"; fi
|
||||||
|
status=`expr $status + $ret`
|
||||||
|
|
||||||
echo "I:exit status: $status"
|
echo "I:exit status: $status"
|
||||||
exit $status
|
exit $status
|
||||||
|
@@ -743,6 +743,7 @@ dns_viewlist_findzone(dns_viewlist_t *list, dns_name_t *name, isc_boolean_t allc
|
|||||||
* Returns:
|
* Returns:
|
||||||
*\li #ISC_R_SUCCESS A matching zone was found.
|
*\li #ISC_R_SUCCESS A matching zone was found.
|
||||||
*\li #ISC_R_NOTFOUND No matching zone was found.
|
*\li #ISC_R_NOTFOUND No matching zone was found.
|
||||||
|
*\li #ISC_R_MULTIPLE Multiple zones with the same name were found.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
|
@@ -1441,7 +1441,7 @@ dns_viewlist_findzone(dns_viewlist_t *list, dns_name_t *name,
|
|||||||
if (zone2 != NULL) {
|
if (zone2 != NULL) {
|
||||||
dns_zone_detach(&zone1);
|
dns_zone_detach(&zone1);
|
||||||
dns_zone_detach(&zone2);
|
dns_zone_detach(&zone2);
|
||||||
return (ISC_R_NOTFOUND);
|
return (ISC_R_MULTIPLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -88,9 +88,10 @@
|
|||||||
#define ISC_R_BADADDRESSFORM 59 /*%< invalid address format */
|
#define ISC_R_BADADDRESSFORM 59 /*%< invalid address format */
|
||||||
#define ISC_R_BADBASE32 60 /*%< bad base32 encoding */
|
#define ISC_R_BADBASE32 60 /*%< bad base32 encoding */
|
||||||
#define ISC_R_UNSET 61 /*%< unset */
|
#define ISC_R_UNSET 61 /*%< unset */
|
||||||
|
#define ISC_R_MULTIPLE 62 /*%< multiple */
|
||||||
|
|
||||||
/*% Not a result code: the number of results. */
|
/*% Not a result code: the number of results. */
|
||||||
#define ISC_R_NRESULTS 62
|
#define ISC_R_NRESULTS 63
|
||||||
|
|
||||||
ISC_LANG_BEGINDECLS
|
ISC_LANG_BEGINDECLS
|
||||||
|
|
||||||
|
@@ -103,6 +103,7 @@ static const char *text[ISC_R_NRESULTS] = {
|
|||||||
"invalid address format", /*%< 59 */
|
"invalid address format", /*%< 59 */
|
||||||
"bad base32 encoding", /*%< 60 */
|
"bad base32 encoding", /*%< 60 */
|
||||||
"unset", /*%< 61 */
|
"unset", /*%< 61 */
|
||||||
|
"multiple", /*%< 62 */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ISC_RESULT_RESULTSET 2
|
#define ISC_RESULT_RESULTSET 2
|
||||||
|
Reference in New Issue
Block a user