Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
BIND
Commits
40aadb6a
Commit
40aadb6a
authored
May 15, 2007
by
Mark Andrews
Browse files
2179. [func] 'rndc command zone' will now find 'zone' if it is
unique to all the views. [RT #16821]
parent
65b26a4d
Changes
4
Hide whitespace changes
Inline
Side-by-side
CHANGES
View file @
40aadb6a
2179. [func] 'rndc command zone' will now find 'zone' if it is
unique to all the views. [RT #16821]
2178. [bug] 'rndc reload' of a slave or stub zone resulted in
a reference leak. [RT #16867]
...
...
bin/named/server.c
View file @
40aadb6a
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.c,v 1.48
4
2007/05/15 02:
2
8:
27
marka Exp $ */
/* $Id: server.c,v 1.48
5
2007/05/15 02:
3
8:
34
marka Exp $ */
/*! \file */
...
...
@@ -4124,23 +4124,28 @@ zone_from_args(ns_server_t *server, char *args, dns_zone_t **zonep) {
result
=
dns_rdataclass_fromtext
(
&
rdclass
,
&
r
);
if
(
result
!=
ISC_R_SUCCESS
)
goto
fail1
;
}
else
{
}
else
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
);
result
=
dns_zt_find
(
view
->
zonetable
,
dns_fixedname_name
(
&
name
),
0
,
NULL
,
zonep
);
dns_view_detach
(
&
view
);
}
/* Partial match? */
if
(
result
!=
ISC_R_SUCCESS
&&
*
zonep
!=
NULL
)
dns_zone_detach
(
zonep
);
dns_view_detach
(
&
view
);
fail1:
return
(
result
);
}
...
...
lib/dns/include/dns/view.h
View file @
40aadb6a
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: view.h,v 1.10
5
2007/0
3/29 23:47:04 tbox
Exp $ */
/* $Id: view.h,v 1.10
6
2007/0
5/15 02:38:34 marka
Exp $ */
#ifndef DNS_VIEW_H
#define DNS_VIEW_H 1
...
...
@@ -594,6 +594,19 @@ dns_viewlist_find(dns_viewlist_t *list, const char *name,
*\li #ISC_R_NOTFOUND No matching view was found.
*/
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
);
/*%<
...
...
lib/dns/view.c
View file @
40aadb6a
...
...
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: view.c,v 1.14
1
2007/0
3/29
0
6
:3
6
:3
0
marka Exp $ */
/* $Id: view.c,v 1.14
2
2007/0
5/15
0
2
:3
8
:3
4
marka Exp $ */
/*! \file */
...
...
@@ -1146,6 +1146,40 @@ dns_viewlist_find(dns_viewlist_t *list, const char *name,
return
(
ISC_R_SUCCESS
);
}
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
)
{
dns_view_t
*
view
;
isc_result_t
result
;
dns_zone_t
*
zone1
=
NULL
,
*
zone2
=
NULL
;
REQUIRE
(
list
!=
NULL
);
for
(
view
=
ISC_LIST_HEAD
(
*
list
);
view
!=
NULL
;
view
=
ISC_LIST_NEXT
(
view
,
link
))
{
if
(
allclasses
==
ISC_FALSE
&&
view
->
rdclass
!=
rdclass
)
continue
;
result
=
dns_zt_find
(
view
->
zonetable
,
name
,
0
,
NULL
,
(
zone1
==
NULL
)
?
&
zone1
:
&
zone2
);
INSIST
(
result
==
ISC_R_SUCCESS
||
result
==
ISC_R_NOTFOUND
);
if
(
zone2
!=
NULL
)
{
dns_zone_detach
(
&
zone1
);
dns_zone_detach
(
&
zone2
);
return
(
ISC_R_NOTFOUND
);
}
}
if
(
zone1
!=
NULL
)
{
dns_zone_attach
(
zone1
,
zonep
);
dns_zone_detach
(
&
zone1
);
return
(
ISC_R_SUCCESS
);
}
return
(
ISC_R_NOTFOUND
);
}
isc_result_t
dns_view_load
(
dns_view_t
*
view
,
isc_boolean_t
stop
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment