Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > fc4f4d32ce4b1a90e7e68ed631842990 > files > 8

bind-9.3.6-25.P1.el5_11.9.src.rpm

diff -up bind-9.3.6-P1/bin/named/server.c.freeze bind-9.3.6-P1/bin/named/server.c
--- bind-9.3.6-P1/bin/named/server.c.freeze	2008-09-05 01:45:32.000000000 +0200
+++ bind-9.3.6-P1/bin/named/server.c	2009-02-18 19:55:26.000000000 +0100
@@ -3514,19 +3514,25 @@ zone_from_args(ns_server_t *server, char
 		rdclass = dns_rdataclass_in;
 	}
 
-	if (viewtxt == NULL)
-		viewtxt = "_default";
-	result = dns_viewlist_find(&server->viewlist, viewtxt,
-				   rdclass, &view);
-	if (result != ISC_R_SUCCESS)
-		goto fail1;
+	if (viewtxt == NULL) {
+		result = dns_viewlist_findzone(&server->viewlist,
+					       dns_fixedname_name(&name),
+					       ISC_TF(classtxt == NULL),
+					       rdclass, zonep);
+	} else {
+		result = dns_viewlist_find(&server->viewlist, viewtxt,
+					   rdclass, &view);
+		if (result != ISC_R_SUCCESS)
+			goto fail1;
+
+		result = dns_zt_find(view->zonetable, dns_fixedname_name(&name),
+				     0, NULL, zonep);
+		dns_view_detach(&view);
+	}
 
-	result = dns_zt_find(view->zonetable, dns_fixedname_name(&name),
-			     0, NULL, zonep);
 	/* Partial match? */
 	if (result != ISC_R_SUCCESS && *zonep != NULL)
 		dns_zone_detach(zonep);
-	dns_view_detach(&view);
  fail1:
 	return (result);
 }
diff -up bind-9.3.6-P1/lib/dns/include/dns/view.h.freeze bind-9.3.6-P1/lib/dns/include/dns/view.h
--- bind-9.3.6-P1/lib/dns/include/dns/view.h.freeze	2004-03-10 03:55:58.000000000 +0100
+++ bind-9.3.6-P1/lib/dns/include/dns/view.h	2009-02-18 19:53:23.000000000 +0100
@@ -584,6 +584,19 @@ dns_viewlist_find(dns_viewlist_t *list, 
  */
 
 isc_result_t
+dns_viewlist_findzone(dns_viewlist_t *list, dns_name_t *name,
+		      isc_boolean_t allclasses,
+		      dns_rdataclass_t rdclass, dns_zone_t **zonep);
+/*%<
+ * Search zone with 'name' in view with 'rdclass' in viewlist 'list'
+ * If found, zone is returned in *zonep. If allclasses is set rdclass is ignored
+ *
+ * Returns:
+ *\li #ISC_R_SUCCESS          A matching zone was found.
+ *\li #ISC_R_NOTFOUND         No matching zone was found.
+ */
+
+isc_result_t
 dns_view_findzone(dns_view_t *view, dns_name_t *name, dns_zone_t **zonep);
 /*
  * Search for the zone 'name' in the zone table of 'view'.