From 8fe9e9c463958e0a63b8216c9b277d88282227be Mon Sep 17 00:00:00 2001 From: Paul Wouters Date: Fri, 9 Nov 2007 16:57:09 +0000 Subject: [PATCH] - Added patch for ldns-read-zone that does not put @. in RRDATA --- ldns.spec | 8 ++++-- ldns_1.2.1_origin.patch | 56 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 ldns_1.2.1_origin.patch diff --git a/ldns.spec b/ldns.spec index 5e741fc..afd38fb 100644 --- a/ldns.spec +++ b/ldns.spec @@ -1,11 +1,12 @@ Summary: Lowlevel DNS(SEC) library with API Name: ldns Version: 1.2.1 -Release: 2%{?dist} +Release: 3%{?dist} License: BSD Url: http://open.nlnetlabs.nl/%{name}/ Source: http://open.nlnetlabs.nl/downloads/%{name}-%{version}.tar.gz Group: System Environment/Libraries +Patch0: ldns_1.2.1_origin.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libtool, autoconf, automake, gcc-c++, openssl-devel, doxygen, perl libpcap-devel @@ -25,7 +26,7 @@ The devel package contains the ldns library and the include files %prep %setup -q - +%patch0 # To built svn snapshots #rm config.guess config.sub ltmain.sh #libtoolize @@ -83,6 +84,9 @@ rm -rf %{buildroot} %postun -p /sbin/ldconfig %changelog +* Fri Nov 9 2007 Paul Wouters - 1.2.1-3 +- Added patch for ldns-read-zone that does not put @. in RRDATA + * Fri Oct 19 2007 Paul Wouters - 1.2.1-2 - Use install -p to work around multilib conflicts for .h files diff --git a/ldns_1.2.1_origin.patch b/ldns_1.2.1_origin.patch new file mode 100644 index 0000000..c0c3384 --- /dev/null +++ b/ldns_1.2.1_origin.patch @@ -0,0 +1,56 @@ +Index: zone.c +=================================================================== +--- zone.c (revision 2480) ++++ zone.c (revision 2482) +@@ -181,7 +181,8 @@ + /* also set the prev */ + my_prev = ldns_rdf_clone(origin); + } else { +- my_origin = ldns_dname_new_frm_str("."); ++ my_origin = NULL; ++ /*my_origin = ldns_dname_new_frm_str(".");*/ + my_prev = NULL; + } + +@@ -198,6 +199,10 @@ + } + soa_seen = true; + ldns_zone_set_soa(newzone, rr); ++ /* set origin to soa if not specified */ ++ if (!my_origin) { ++ my_origin = ldns_rdf_clone(ldns_rr_owner(rr)); ++ } + continue; + } + +Index: rr.c +=================================================================== +--- rr.c (revision 2480) ++++ rr.c (revision 2482) +@@ -417,11 +417,22 @@ + ldns_rr_descriptor_field_type(desc, r_cnt), + rd); + +- /* check if the origin should be concatenated */ +- if (rd_strlen > 1 && !ldns_dname_str_absolute(rd) && origin) { ++ /* check if the origin should be used or concatenated */ ++ if (rd_strlen == 1 && ldns_rdf_data(r)[1] == '@') { ++ ldns_rdf_deep_free(r); ++ if (origin) { ++ r = ldns_rdf_clone(origin); ++ } else { ++ /* if this is the SOA, use its own owner name */ ++ if (rr_type == LDNS_RR_TYPE_SOA) { ++ r = ldns_rdf_clone(ldns_rr_owner(new)); ++ } else { ++ r = ldns_rdf_new_frm_str(LDNS_RDF_TYPE_DNAME, "."); ++ } ++ } ++ } else if (rd_strlen > 1 && !ldns_dname_str_absolute(rd) && origin) { + if (!ldns_dname_cat(r, origin)) { +- /* don't change this (yet MIEK */ +- /* return LDNS_STATUS_SYNTAX_ERR; */ ++ return LDNS_STATUS_ERR; + } + } + break;