Improve patch for #725741

Signed-off-by: Adam Tkac <atkac@redhat.com>
This commit is contained in:
Adam Tkac 2011-08-03 15:43:08 +02:00
parent 3eb67c23c1
commit 6322cef147
3 changed files with 30 additions and 15 deletions

View File

@ -156,20 +156,6 @@ diff -up bind-9.8.0-P4/bin/named/server.c.dyndb bind-9.8.0-P4/bin/named/server.c
/* /*
* Parse the global default pseudo-config file. * Parse the global default pseudo-config file.
*/ */
@@ -5542,6 +5642,13 @@ loadconfig(ns_server_t *server) {
static isc_result_t
reload(ns_server_t *server) {
isc_result_t result;
+
+ /* Ensure there is no other access to the server */
+ result = isc_task_beginexclusive(server->task);
+ RUNTIME_CHECK(result == ISC_R_SUCCESS);
+ dns_dynamic_db_cleanup(ISC_FALSE);
+ isc_task_endexclusive(server->task);
+
CHECK(loadconfig(server));
result = load_zones(server, ISC_FALSE);
diff -up bind-9.8.0-P4/lib/dns/dynamic_db.c.dyndb bind-9.8.0-P4/lib/dns/dynamic_db.c diff -up bind-9.8.0-P4/lib/dns/dynamic_db.c.dyndb bind-9.8.0-P4/lib/dns/dynamic_db.c
--- bind-9.8.0-P4/lib/dns/dynamic_db.c.dyndb 2011-07-26 15:36:04.047778520 +0200 --- bind-9.8.0-P4/lib/dns/dynamic_db.c.dyndb 2011-07-26 15:36:04.047778520 +0200
+++ bind-9.8.0-P4/lib/dns/dynamic_db.c 2011-07-26 15:36:04.047778520 +0200 +++ bind-9.8.0-P4/lib/dns/dynamic_db.c 2011-07-26 15:36:04.047778520 +0200

View File

@ -22,7 +22,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv
Name: bind Name: bind
License: ISC License: ISC
Version: 9.8.0 Version: 9.8.0
Release: 8.%{PATCHVER}%{?dist} Release: 9.%{PATCHVER}%{?dist}
Epoch: 32 Epoch: 32
Url: http://www.isc.org/products/BIND/ Url: http://www.isc.org/products/BIND/
Buildroot:%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Buildroot:%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@ -64,6 +64,7 @@ Patch112:bind97-rh645544.patch
Patch113:bind97-rh674334.patch Patch113:bind97-rh674334.patch
Patch115:bind97-cleanup.patch Patch115:bind97-cleanup.patch
Patch116:bind98-includes.patch Patch116:bind98-includes.patch
Patch117:bind98-rh725741.patch
# SDB patches # SDB patches
Patch11: bind-9.3.2b2-sdbsrc.patch Patch11: bind-9.3.2b2-sdbsrc.patch
@ -247,6 +248,7 @@ Based on the code from Jan "Yenya" Kasprzak <kas@fi.muni.cz>
%patch10 -p1 -b .PIE %patch10 -p1 -b .PIE
%patch16 -p1 -b .redhat_doc %patch16 -p1 -b .redhat_doc
%patch104 -p1 -b .dyndb %patch104 -p1 -b .dyndb
%patch117 -p1 -b .rh725741
%if %{SDB} %if %{SDB}
%patch101 -p1 -b .old-api %patch101 -p1 -b .old-api
mkdir bin/named-sdb mkdir bin/named-sdb
@ -770,6 +772,9 @@ rm -rf ${RPM_BUILD_ROOT}
%endif %endif
%changelog %changelog
* Wed Aug 03 2011 Adam Tkac <atkac redhat com> 32:9.8.0-9.P4
- improve patch for #725741
* Tue Jul 26 2011 Adam Tkac <atkac redhat com> 32:9.8.0-8.P4 * Tue Jul 26 2011 Adam Tkac <atkac redhat com> 32:9.8.0-8.P4
- named could have crashed during reload when dyndb module is used (#725741) - named could have crashed during reload when dyndb module is used (#725741)

24
bind98-rh725741.patch Normal file
View File

@ -0,0 +1,24 @@
diff -up bind-9.8.0-P4/bin/named/main.c.rh725741 bind-9.8.0-P4/bin/named/main.c
--- bind-9.8.0-P4/bin/named/main.c.rh725741 2011-08-03 15:20:28.487516386 +0200
+++ bind-9.8.0-P4/bin/named/main.c 2011-08-03 15:20:50.197514932 +0200
@@ -872,8 +872,6 @@ setup(void) {
static void
cleanup(void) {
- dns_dynamic_db_cleanup(ISC_TRUE);
-
destroy_managers();
ns_server_destroy(&ns_g_server);
diff -up bind-9.8.0-P4/bin/named/server.c.rh725741 bind-9.8.0-P4/bin/named/server.c
--- bind-9.8.0-P4/bin/named/server.c.rh725741 2011-08-03 15:20:42.009515447 +0200
+++ bind-9.8.0-P4/bin/named/server.c 2011-08-03 15:21:01.878514035 +0200
@@ -5263,6 +5263,8 @@ shutdown_server(isc_task_t *task, isc_ev
dns_view_detach(&view);
}
+ dns_dynamic_db_cleanup(ISC_TRUE);
+
while ((nsc = ISC_LIST_HEAD(server->cachelist)) != NULL) {
ISC_LIST_UNLINK(server->cachelist, nsc, link);
dns_cache_detach(&nsc->cache);