From 6cd938d8ced0ffb1b7b331995653fa84bf9f7205 Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Mar 05 2012 13:22:52 +0000 Subject: Include some fixes... - load dynamic DBs later (and update dyndb patch) - fix memory leak in named during processing of rndc command Signed-off-by: Adam Tkac --- diff --git a/bind-96-dyndb.patch b/bind-96-dyndb.patch index 0007966..bc9bc4a 100644 --- a/bind-96-dyndb.patch +++ b/bind-96-dyndb.patch @@ -1,6 +1,6 @@ -diff -up bind-9.9.0b2/bin/named/main.c.dyndb bind-9.9.0b2/bin/named/main.c ---- bind-9.9.0b2/bin/named/main.c.dyndb 2011-11-09 19:44:03.000000000 +0100 -+++ bind-9.9.0b2/bin/named/main.c 2011-11-22 12:56:27.907485613 +0100 +diff -up bind-9.9.0/bin/named/main.c.dyndb bind-9.9.0/bin/named/main.c +--- bind-9.9.0/bin/named/main.c.dyndb 2012-02-07 00:46:22.000000000 +0100 ++++ bind-9.9.0/bin/named/main.c 2012-03-05 13:53:07.260068145 +0100 @@ -45,6 +45,7 @@ #include @@ -9,18 +9,9 @@ diff -up bind-9.9.0b2/bin/named/main.c.dyndb bind-9.9.0b2/bin/named/main.c #include #include #include -@@ -914,6 +915,8 @@ setup(void) { - - static void - cleanup(void) { -+ dns_dynamic_db_cleanup(ISC_TRUE); -+ - destroy_managers(); - - ns_server_destroy(&ns_g_server); -diff -up bind-9.9.0b2/bin/named/server.c.dyndb bind-9.9.0b2/bin/named/server.c ---- bind-9.9.0b2/bin/named/server.c.dyndb 2011-11-09 19:44:03.000000000 +0100 -+++ bind-9.9.0b2/bin/named/server.c 2011-11-22 12:56:27.911485608 +0100 +diff -up bind-9.9.0/bin/named/server.c.dyndb bind-9.9.0/bin/named/server.c +--- bind-9.9.0/bin/named/server.c.dyndb 2012-02-23 08:02:18.000000000 +0100 ++++ bind-9.9.0/bin/named/server.c 2012-03-05 13:54:03.620914961 +0100 @@ -63,6 +63,7 @@ #include #include @@ -29,7 +20,7 @@ diff -up bind-9.9.0b2/bin/named/server.c.dyndb bind-9.9.0b2/bin/named/server.c #include #include #include -@@ -1164,6 +1165,72 @@ configure_peer(const cfg_obj_t *cpeer, i +@@ -1161,6 +1162,72 @@ configure_peer(const cfg_obj_t *cpeer, i } static isc_result_t @@ -102,7 +93,7 @@ diff -up bind-9.9.0b2/bin/named/server.c.dyndb bind-9.9.0b2/bin/named/server.c disable_algorithms(const cfg_obj_t *disabled, dns_resolver_t *resolver) { isc_result_t result; const cfg_obj_t *algorithms; -@@ -1575,6 +1642,7 @@ configure_view(dns_view_t *view, cfg_obj +@@ -1572,6 +1639,7 @@ configure_view(dns_view_t *view, cfg_obj const cfg_obj_t *dlz; unsigned int dlzargc; char **dlzargv; @@ -110,13 +101,19 @@ diff -up bind-9.9.0b2/bin/named/server.c.dyndb bind-9.9.0b2/bin/named/server.c const cfg_obj_t *disabled; const cfg_obj_t *obj; const cfg_listelt_t *element; -@@ -1805,6 +1873,39 @@ configure_view(dns_view_t *view, cfg_obj +@@ -1801,6 +1869,8 @@ configure_view(dns_view_t *view, cfg_obj } } + + -+ /* + /* + * Obtain configuration parameters that affect the decision of whether + * we can reuse/share an existing cache. +@@ -2693,6 +2763,37 @@ configure_view(dns_view_t *view, cfg_obj + dns_view_setrootdelonly(view, ISC_FALSE); + + /* + * Configure dynamic databases. + */ + dynamic_db_list = NULL; @@ -147,10 +144,11 @@ diff -up bind-9.9.0b2/bin/named/server.c.dyndb bind-9.9.0b2/bin/named/server.c + dns_dyndb_arguments_destroy(mctx, args); + } + - /* - * Obtain configuration parameters that affect the decision of whether - * we can reuse/share an existing cache. -@@ -4360,6 +4461,7 @@ load_configuration(const char *filename, ++ /* + * Setup automatic empty zones. If recursion is off then + * they are disabled by default. + */ +@@ -4340,6 +4441,7 @@ load_configuration(const char *filename, cfg_aclconfctx_detach(&ns_g_aclconfctx); CHECK(cfg_aclconfctx_create(ns_g_mctx, &ns_g_aclconfctx)); @@ -158,9 +156,18 @@ diff -up bind-9.9.0b2/bin/named/server.c.dyndb bind-9.9.0b2/bin/named/server.c /* * Parse the global default pseudo-config file. */ -diff -up bind-9.9.0b2/lib/dns/dynamic_db.c.dyndb bind-9.9.0b2/lib/dns/dynamic_db.c ---- bind-9.9.0b2/lib/dns/dynamic_db.c.dyndb 2011-11-22 12:56:27.912485606 +0100 -+++ bind-9.9.0b2/lib/dns/dynamic_db.c 2011-11-22 12:56:27.912485606 +0100 +@@ -5434,6 +5536,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); +diff -up bind-9.9.0/lib/dns/dynamic_db.c.dyndb bind-9.9.0/lib/dns/dynamic_db.c +--- bind-9.9.0/lib/dns/dynamic_db.c.dyndb 2012-03-05 13:53:07.249068386 +0100 ++++ bind-9.9.0/lib/dns/dynamic_db.c 2012-03-05 13:53:07.250068364 +0100 @@ -0,0 +1,366 @@ +/* + * Copyright (C) 2008-2011 Red Hat, Inc. @@ -528,9 +535,9 @@ diff -up bind-9.9.0b2/lib/dns/dynamic_db.c.dyndb bind-9.9.0b2/lib/dns/dynamic_db + + return args->timermgr; +} -diff -up bind-9.9.0b2/lib/dns/include/dns/dynamic_db.h.dyndb bind-9.9.0b2/lib/dns/include/dns/dynamic_db.h ---- bind-9.9.0b2/lib/dns/include/dns/dynamic_db.h.dyndb 2011-11-22 12:56:27.912485606 +0100 -+++ bind-9.9.0b2/lib/dns/include/dns/dynamic_db.h 2011-11-22 12:56:27.913485604 +0100 +diff -up bind-9.9.0/lib/dns/include/dns/dynamic_db.h.dyndb bind-9.9.0/lib/dns/include/dns/dynamic_db.h +--- bind-9.9.0/lib/dns/include/dns/dynamic_db.h.dyndb 2012-03-05 13:53:07.250068364 +0100 ++++ bind-9.9.0/lib/dns/include/dns/dynamic_db.h 2012-03-05 13:53:07.250068364 +0100 @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2008-2011 Red Hat, Inc. @@ -582,9 +589,9 @@ diff -up bind-9.9.0b2/lib/dns/include/dns/dynamic_db.h.dyndb bind-9.9.0b2/lib/dn +isc_timermgr_t *dns_dyndb_get_timermgr(dns_dyndb_arguments_t *args); + +#endif -diff -up bind-9.9.0b2/lib/dns/include/dns/log.h.dyndb bind-9.9.0b2/lib/dns/include/dns/log.h ---- bind-9.9.0b2/lib/dns/include/dns/log.h.dyndb 2011-10-14 00:48:24.000000000 +0200 -+++ bind-9.9.0b2/lib/dns/include/dns/log.h 2011-11-22 12:56:27.913485604 +0100 +diff -up bind-9.9.0/lib/dns/include/dns/log.h.dyndb bind-9.9.0/lib/dns/include/dns/log.h +--- bind-9.9.0/lib/dns/include/dns/log.h.dyndb 2011-10-14 00:48:24.000000000 +0200 ++++ bind-9.9.0/lib/dns/include/dns/log.h 2012-03-05 13:53:07.250068364 +0100 @@ -75,6 +75,7 @@ LIBDNS_EXTERNAL_DATA extern isc_logmodul #define DNS_LOGMODULE_ACACHE (&dns_modules[25]) #define DNS_LOGMODULE_DLZ (&dns_modules[26]) @@ -593,9 +600,9 @@ diff -up bind-9.9.0b2/lib/dns/include/dns/log.h.dyndb bind-9.9.0b2/lib/dns/inclu ISC_LANG_BEGINDECLS -diff -up bind-9.9.0b2/lib/dns/include/dns/Makefile.in.dyndb bind-9.9.0b2/lib/dns/include/dns/Makefile.in ---- bind-9.9.0b2/lib/dns/include/dns/Makefile.in.dyndb 2011-11-14 19:32:34.000000000 +0100 -+++ bind-9.9.0b2/lib/dns/include/dns/Makefile.in 2011-11-22 12:56:56.309437358 +0100 +diff -up bind-9.9.0/lib/dns/include/dns/Makefile.in.dyndb bind-9.9.0/lib/dns/include/dns/Makefile.in +--- bind-9.9.0/lib/dns/include/dns/Makefile.in.dyndb 2011-11-14 19:32:34.000000000 +0100 ++++ bind-9.9.0/lib/dns/include/dns/Makefile.in 2012-03-05 13:53:07.251068342 +0100 @@ -22,7 +22,7 @@ top_srcdir = @top_srcdir@ @BIND9_VERSION@ @@ -605,9 +612,9 @@ diff -up bind-9.9.0b2/lib/dns/include/dns/Makefile.in.dyndb bind-9.9.0b2/lib/dns dlz.h dnssec.h ds.h events.h fixedname.h iptable.h journal.h \ keyflags.h keytable.h keyvalues.h lib.h log.h \ master.h masterdump.h message.h name.h ncache.h nsec.h \ -diff -up bind-9.9.0b2/lib/dns/include/dns/types.h.dyndb bind-9.9.0b2/lib/dns/include/dns/types.h ---- bind-9.9.0b2/lib/dns/include/dns/types.h.dyndb 2011-07-02 01:47:44.000000000 +0200 -+++ bind-9.9.0b2/lib/dns/include/dns/types.h 2011-11-22 12:56:27.914485602 +0100 +diff -up bind-9.9.0/lib/dns/include/dns/types.h.dyndb bind-9.9.0/lib/dns/include/dns/types.h +--- bind-9.9.0/lib/dns/include/dns/types.h.dyndb 2011-12-08 17:07:21.000000000 +0100 ++++ bind-9.9.0/lib/dns/include/dns/types.h 2012-03-05 13:53:07.251068342 +0100 @@ -60,6 +60,7 @@ typedef struct dns_dbtable dns_dbtable typedef void dns_dbversion_t; typedef struct dns_dlzimplementation dns_dlzimplementation_t; @@ -616,9 +623,9 @@ diff -up bind-9.9.0b2/lib/dns/include/dns/types.h.dyndb bind-9.9.0b2/lib/dns/inc typedef struct dns_sdlzimplementation dns_sdlzimplementation_t; typedef struct dns_decompress dns_decompress_t; typedef struct dns_dispatch dns_dispatch_t; -diff -up bind-9.9.0b2/lib/dns/log.c.dyndb bind-9.9.0b2/lib/dns/log.c ---- bind-9.9.0b2/lib/dns/log.c.dyndb 2011-10-14 00:48:24.000000000 +0200 -+++ bind-9.9.0b2/lib/dns/log.c 2011-11-22 12:56:27.915485600 +0100 +diff -up bind-9.9.0/lib/dns/log.c.dyndb bind-9.9.0/lib/dns/log.c +--- bind-9.9.0/lib/dns/log.c.dyndb 2011-10-14 00:48:24.000000000 +0200 ++++ bind-9.9.0/lib/dns/log.c 2012-03-05 13:53:07.251068342 +0100 @@ -81,6 +81,7 @@ LIBDNS_EXTERNAL_DATA isc_logmodule_t dns { "dns/acache", 0 }, { "dns/dlz", 0 }, @@ -627,9 +634,9 @@ diff -up bind-9.9.0b2/lib/dns/log.c.dyndb bind-9.9.0b2/lib/dns/log.c { NULL, 0 } }; -diff -up bind-9.9.0b2/lib/dns/Makefile.in.dyndb bind-9.9.0b2/lib/dns/Makefile.in ---- bind-9.9.0b2/lib/dns/Makefile.in.dyndb 2011-11-22 12:56:27.894485636 +0100 -+++ bind-9.9.0b2/lib/dns/Makefile.in 2011-11-22 12:56:27.915485600 +0100 +diff -up bind-9.9.0/lib/dns/Makefile.in.dyndb bind-9.9.0/lib/dns/Makefile.in +--- bind-9.9.0/lib/dns/Makefile.in.dyndb 2012-03-05 13:53:07.229068824 +0100 ++++ bind-9.9.0/lib/dns/Makefile.in 2012-03-05 13:53:07.252068320 +0100 @@ -58,7 +58,7 @@ DNSOBJS = acache.@O@ acl.@O@ adb.@O@ bya cache.@O@ callbacks.@O@ clientinfo.@O@ compress.@O@ \ db.@O@ dbiterator.@O@ dbtable.@O@ diff.@O@ dispatch.@O@ \ @@ -660,9 +667,9 @@ diff -up bind-9.9.0b2/lib/dns/Makefile.in.dyndb bind-9.9.0b2/lib/dns/Makefile.in libdns.@SA@: ${OBJS} ${AR} ${ARFLAGS} $@ ${OBJS} ${RANLIB} $@ -diff -up bind-9.9.0b2/lib/isccfg/namedconf.c.dyndb bind-9.9.0b2/lib/isccfg/namedconf.c ---- bind-9.9.0b2/lib/isccfg/namedconf.c.dyndb 2011-11-07 01:14:11.000000000 +0100 -+++ bind-9.9.0b2/lib/isccfg/namedconf.c 2011-11-22 12:56:27.917485596 +0100 +diff -up bind-9.9.0/lib/isccfg/namedconf.c.dyndb bind-9.9.0/lib/isccfg/namedconf.c +--- bind-9.9.0/lib/isccfg/namedconf.c.dyndb 2011-11-07 01:14:11.000000000 +0100 ++++ bind-9.9.0/lib/isccfg/namedconf.c 2012-03-05 13:53:07.253068299 +0100 @@ -89,6 +89,7 @@ static cfg_type_t cfg_type_controls; static cfg_type_t cfg_type_controls_sockaddr; static cfg_type_t cfg_type_destinationlist; diff --git a/bind.spec b/bind.spec index 8e6f629..f508e63 100644 --- a/bind.spec +++ b/bind.spec @@ -66,7 +66,6 @@ Patch109:bind97-rh478718.patch Patch110:bind97-rh570851.patch Patch111:bind97-exportlib.patch Patch112:bind97-rh645544.patch -Patch117:bind98-rh725741.patch Patch118:bind97-rh699951.patch Patch119:bind97-rh693982.patch Patch121:bind97-rh714049.patch @@ -75,6 +74,7 @@ Patch124:nslookup-norec.patch Patch125:bind99-buildfix.patch Patch126:bind99-v6only.patch Patch127:bind99-forward.patch +Patch128:bind99-coverity.patch # SDB patches Patch11: bind-9.3.2b2-sdbsrc.patch @@ -241,7 +241,7 @@ Based on the code from Jan "Yenya" Kasprzak %patch10 -p1 -b .PIE %patch16 -p1 -b .redhat_doc %patch104 -p1 -b .dyndb -%patch117 -p1 -b .rh725741 +%patch128 -p1 -b .coverity %if %{SDB} %patch101 -p1 -b .old-api mkdir bin/named-sdb @@ -777,6 +777,8 @@ rm -rf ${RPM_BUILD_ROOT} %changelog * Mon Mar 05 2012 Adam Tkac 32:9.9.0-1 - update to 9.9.0 +- load dynamic DBs later (and update dyndb patch) +- fix memory leak in named during processing of rndc command * Wed Feb 15 2012 Adam Tkac 32:9.9.0-0.8.rc2 - build with "--enable-fixed-rrset" diff --git a/bind98-rh725741.patch b/bind98-rh725741.patch deleted file mode 100644 index 53d924d..0000000 --- a/bind98-rh725741.patch +++ /dev/null @@ -1,24 +0,0 @@ -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); diff --git a/bind99-coverity.patch b/bind99-coverity.patch new file mode 100644 index 0000000..ac8d5d1 --- /dev/null +++ b/bind99-coverity.patch @@ -0,0 +1,21 @@ +diff -up bind-9.9.0/bin/named/controlconf.c.coverity bind-9.9.0/bin/named/controlconf.c +--- bind-9.9.0/bin/named/controlconf.c.coverity 2012-03-05 13:57:37.665539706 +0100 ++++ bind-9.9.0/bin/named/controlconf.c 2012-03-05 14:15:15.981420790 +0100 +@@ -373,14 +373,9 @@ control_recvmessage(isc_task_t *task, is + if (result == ISC_R_SUCCESS) + break; + isc_mem_put(listener->mctx, secret.rstart, REGION_SIZE(secret)); +- if (result == ISCCC_R_BADAUTH) { +- /* +- * For some reason, request is non-NULL when +- * isccc_cc_fromwire returns ISCCC_R_BADAUTH. +- */ +- if (request != NULL) +- isccc_sexpr_free(&request); +- } else { ++ /* request can be non-NULL even in failure case */ ++ isccc_sexpr_free(&request); ++ if (result != ISCCC_R_BADAUTH) { + log_invalid(&conn->ccmsg, result); + goto cleanup; + }