libldns: replace patches with proper Git formatted patches
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 29 Mar 2016 15:12:21 +0000 (17:12 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 29 Mar 2016 15:12:21 +0000 (17:12 +0200)
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/libldns/0001-bugfix-548-Double-free-for-answers-4096.patch [new file with mode: 0644]
package/libldns/0001-fix-double-free-for-answers-bigger-than-4096.patch [deleted file]
package/libldns/0002-fix-whitespace-bug-in-ldns-read-zone.patch [deleted file]
package/libldns/0002-whitespace-bug-in-ldns-read-zone.patch [new file with mode: 0644]
package/libldns/0003-doxyparse-manpages.patch [deleted file]
package/libldns/0003-let-doxyparse-output-manpage-generation-issues.patch [new file with mode: 0644]

diff --git a/package/libldns/0001-bugfix-548-Double-free-for-answers-4096.patch b/package/libldns/0001-bugfix-548-Double-free-for-answers-4096.patch
new file mode 100644 (file)
index 0000000..4097cfe
--- /dev/null
@@ -0,0 +1,28 @@
+From 128aeb54593d4dd8ff2403eb2dd7d6cd596717d2 Mon Sep 17 00:00:00 2001
+From: Willem Toorop <willem@nlnetlabs.nl>
+Date: Tue, 28 Jan 2014 11:06:38 +0100
+Subject: [PATCH] bugfix #548: Double free for answers > 4096
+
+in ldns_resolver_send_pkt.  Thank you sunthought@gmail.com
+
+[Backport from upstream commit 2853eb352b4461e98f2926ace4ea3810cedf4167]
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ resolver.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/resolver.c b/resolver.c
+index 16efc90..1474dc8 100644
+--- a/resolver.c
++++ b/resolver.c
+@@ -1117,6 +1117,7 @@ ldns_resolver_send_pkt(ldns_pkt **answer, ldns_resolver *r,
+                                       ldns_pkt_set_edns_udp_size(query_pkt
+                                                       , 4096);
+                                       ldns_pkt_free(answer_pkt);
++                                      answer_pkt = NULL;
+                                       /* Nameservers should not become 
+                                        * unreachable because fragments are
+                                        * dropped (network error). We might
+-- 
+2.6.4
+
diff --git a/package/libldns/0001-fix-double-free-for-answers-bigger-than-4096.patch b/package/libldns/0001-fix-double-free-for-answers-bigger-than-4096.patch
deleted file mode 100644 (file)
index 36bc875..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-Downloaded from
-http://anonscm.debian.org/cgit/pkg-nlnetlabs/ldns.git/plain/debian/patches/fix-double-free-for-answers-bigger-than-4096.patch
-
-which is a backport from upstream
-http://git.nlnetlabs.nl/ldns/commit/?h=develop&id=2853eb352b4461e98f2926ace4ea3810cedf4167
-
-Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
-
-From 2853eb352b4461e98f2926ace4ea3810cedf4167 Mon Sep 17 00:00:00 2001
-From: Willem Toorop <willem@nlnetlabs.nl>
-Date: Tue, 28 Jan 2014 11:06:38 +0100
-Subject: bugfix #548: Double free for answers > 4096
-
-in ldns_resolver_send_pkt.  Thank you sunthought@gmail.com
----
---- ldns.orig/resolver.c
-+++ ldns/resolver.c
-@@ -1117,6 +1117,7 @@ ldns_resolver_send_pkt(ldns_pkt **answer
-                                       ldns_pkt_set_edns_udp_size(query_pkt
-                                                       , 4096);
-                                       ldns_pkt_free(answer_pkt);
-+                                      answer_pkt = NULL;
-                                       /* Nameservers should not become 
-                                        * unreachable because fragments are
-                                        * dropped (network error). We might
diff --git a/package/libldns/0002-fix-whitespace-bug-in-ldns-read-zone.patch b/package/libldns/0002-fix-whitespace-bug-in-ldns-read-zone.patch
deleted file mode 100644 (file)
index 4d8908e..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-Dwonloaded from
-http://anonscm.debian.org/cgit/pkg-nlnetlabs/ldns.git/tree/debian/patches/fix-whitespace-bug-in-ldns-read-zone.patch
-
-which is a backport from
-http://git.nlnetlabs.nl/ldns/commit/?h=develop&id=d6037a22fbedb8ef3a22de4107e4eaa36840865b
-
-Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
-
-From d6037a22fbedb8ef3a22de4107e4eaa36840865b Mon Sep 17 00:00:00 2001
-From: Matthijs Mekking <matthijs@nlnetlabs.nl>
-Date: Wed, 18 Jun 2014 09:55:17 +0200
-Subject: whitespace bug in ldns-read-zone
-
----
---- ldns.orig/rr.c
-+++ ldns/rr.c
-@@ -670,6 +670,18 @@ ldns_rr_new_question_frm_str(ldns_rr **n
-                                           true);
- }
-+static int
-+ldns_rr_is_whitespace_line(char* line, int line_len)
-+{
-+      int i;
-+      for (i = 0; i < line_len; i++) {
-+              if (!isspace((int)line[i])) {
-+                      return 0;
-+              }
-+      }
-+      return 1;
-+}
-+
- ldns_status
- ldns_rr_new_frm_fp(ldns_rr **newrr, FILE *fp, uint32_t *ttl, ldns_rdf **origin, ldns_rdf **prev)
- {
-@@ -745,6 +757,9 @@ ldns_rr_new_frm_fp_l(ldns_rr **newrr, FI
-               s = LDNS_STATUS_SYNTAX_TTL;
-       } else if (strncmp(line, "$INCLUDE", 8) == 0) {
-               s = LDNS_STATUS_SYNTAX_INCLUDE;
-+      } else if (ldns_rr_is_whitespace_line(line, size)) {
-+              LDNS_FREE(line);
-+              return LDNS_STATUS_SYNTAX_EMPTY;
-       } else {
-               if (origin && *origin) {
-                       s = ldns_rr_new_frm_str(&rr, (const char*) line, ttl, *origin, prev);
diff --git a/package/libldns/0002-whitespace-bug-in-ldns-read-zone.patch b/package/libldns/0002-whitespace-bug-in-ldns-read-zone.patch
new file mode 100644 (file)
index 0000000..ec87b18
--- /dev/null
@@ -0,0 +1,47 @@
+From 055ea6aef77058f651b5571d98d2d9458821a977 Mon Sep 17 00:00:00 2001
+From: Matthijs Mekking <matthijs@nlnetlabs.nl>
+Date: Wed, 18 Jun 2014 09:55:17 +0200
+Subject: [PATCH] whitespace bug in ldns-read-zone
+
+[Backport from upstream commit d6037a22fbedb8ef3a22de4107e4eaa36840865b]
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ rr.c | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/rr.c b/rr.c
+index cfee170..e530702 100644
+--- a/rr.c
++++ b/rr.c
+@@ -670,6 +670,18 @@ ldns_rr_new_question_frm_str(ldns_rr **newrr, const char *str,
+                                           true);
+ }
++static int
++ldns_rr_is_whitespace_line(char* line, int line_len)
++{
++      int i;
++      for (i = 0; i < line_len; i++) {
++              if (!isspace((int)line[i])) {
++                      return 0;
++              }
++      }
++      return 1;
++}
++
+ ldns_status
+ ldns_rr_new_frm_fp(ldns_rr **newrr, FILE *fp, uint32_t *ttl, ldns_rdf **origin, ldns_rdf **prev)
+ {
+@@ -745,6 +757,9 @@ ldns_rr_new_frm_fp_l(ldns_rr **newrr, FILE *fp, uint32_t *default_ttl, ldns_rdf
+               s = LDNS_STATUS_SYNTAX_TTL;
+       } else if (strncmp(line, "$INCLUDE", 8) == 0) {
+               s = LDNS_STATUS_SYNTAX_INCLUDE;
++      } else if (ldns_rr_is_whitespace_line(line, size)) {
++              LDNS_FREE(line);
++              return LDNS_STATUS_SYNTAX_EMPTY;
+       } else {
+               if (origin && *origin) {
+                       s = ldns_rr_new_frm_str(&rr, (const char*) line, ttl, *origin, prev);
+-- 
+2.6.4
+
diff --git a/package/libldns/0003-doxyparse-manpages.patch b/package/libldns/0003-doxyparse-manpages.patch
deleted file mode 100644 (file)
index 7aaa0d1..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-From 168ee09a4bf184947798c3ee3ac99b6651470d64 Mon Sep 17 00:00:00 2001
-From: Willem Toorop <willem@nlnetlabs.nl>
-Date: Thu, 27 Nov 2014 16:21:54 +0100
-Subject: let doxyparse output manpage generation issues
-
-This patch fixes a build error with perl 5.22.
-
-Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
-Patch backported from upstream commit:
-http://git.nlnetlabs.nl/ldns/commit/?h=develop&id=168ee09a4bf184947798c3ee3ac99b6651470d64
----
- doc/doxyparse.pl | 45 ++++++++++++++++++++++++++++++++++++++-------
- 1 file changed, 38 insertions(+), 7 deletions(-)
-
-diff --git a/doc/doxyparse.pl b/doc/doxyparse.pl
-index 96a1732..a09b2e8 100755
---- a/doc/doxyparse.pl
-+++ b/doc/doxyparse.pl
-@@ -57,10 +57,15 @@ This manpage was automaticly generated from the ldns source code by
- use of Doxygen and some perl.
- ";
--getopts("m:",\%options);
-+getopts("em:",\%options);
- # if -m manpage file is given process that file
- # parse the file which tells us what manpages go together
- my $functions, $see_also;
-+my $i = -1;
-+my $report_errors = defined $options{'e'};
-+my $errors = 0;
-+my %unique;
-+
- if (defined $options{'m'}) {
-       # process
-       open(MAN, "<$options{'m'}") or die "Cannot open $options{'m'}";
-@@ -68,18 +73,35 @@ if (defined $options{'m'}) {
-               # func1, func2, .. | see_also1, see_also2, ...
-               while(<MAN>) {
-                       chomp;
-+                      $i += 1;
-                       if (/^#/) { next; }
-                       if (/^$/) { next; }
--                      ($functions, $see_also) = split /[\t ]*\|[\t ]*/, $_;
--                      #print "{$functions}\n";
--                      #print "{$see_also}\n";
-+                      my @parts = split /[\t ]*\|[\t ]*/, $_;
-+                      $functions = shift @parts;
-+                      $see_also = join ', ', @parts;
-+                      print "{$functions}\n";
-+                      print "{$see_also}\n";
-                       my @funcs = split /[\t ]*,[\t ]*/, $functions;
-                       my @also = split /[\t ]*,[\t ]*/, $see_also;
-                       $manpages{$funcs[0]} = \@funcs;
-                       $see_also{$funcs[0]} = \@also;
-+                      foreach (@funcs) {
-+                              if ($unique{$_}) {
-+                                      push $unique{$_}, ($i,);
-+                              } else {
-+                                      $unique{$_} = [$i];
-+                              }
-+                      }
-                       #print "[", $funcs[0], "]\n";
-               }
-       close(MAN);
-+      while (($func, $lines) = each %unique ) {
-+              if (scalar @$lines > 1) {
-+                      print STDERR "$func in function_manpages on lines: "
-+                          . join(", ",@$lines) . "\n" if $report_errors;
-+                      $errors += 1;
-+              }
-+      }
- } else {
-       print "Need -m file to process the .h files\n";
-       exit 1;
-@@ -95,7 +117,7 @@ mkdir "doc/man";
- mkdir "doc/man/man$MAN_SECTION";
- $state = 0;
--my $i;
-+$i = 0;
- my @lines = <STDIN>;
- my $max = @lines;
-@@ -273,7 +295,7 @@ foreach (keys %manpages) {
-       print MAN $MAN_MIDDLE;
--      if (defined(@$also)) {
-+      if (@$also) {
-               print MAN "\n.SH SEE ALSO\n\\fI";
-               print MAN join "\\fR, \\fI", @$also;
-               print MAN "\\fR.\nAnd ";
-@@ -290,7 +312,7 @@ foreach (keys %manpages) {
-       # create symlinks
-       chdir("$BASE/man$MAN_SECTION");
-       foreach (@$name) {
--              print STDERR $_,"\n";
-+              print STDOUT $_,"\n";
-               my $new_file = $_ . "." . $MAN_SECTION;
-               if ($new_file eq $symlink_file) {
-                       next;
-@@ -301,3 +323,12 @@ foreach (keys %manpages) {
-       chdir("../../.."); # and back, tricky and fragile...
-       close(MAN);
- }
-+foreach (keys %api) {
-+      next if (/ / || /^$/);
-+      if (not $unique{$_}) {
-+              print STDERR "no man page for $_\n" if $report_errors;
-+              $errors += 1;
-+      }
-+}
-+
-+exit ($report_errors and $errors != 0);
--- 
-cgit v0.11.2
-
diff --git a/package/libldns/0003-let-doxyparse-output-manpage-generation-issues.patch b/package/libldns/0003-let-doxyparse-output-manpage-generation-issues.patch
new file mode 100644 (file)
index 0000000..223ebe9
--- /dev/null
@@ -0,0 +1,116 @@
+From d8a3da12be085fbc92e3d4d4d084c328fc37485a Mon Sep 17 00:00:00 2001
+From: Willem Toorop <willem@nlnetlabs.nl>
+Date: Thu, 27 Nov 2014 16:21:54 +0100
+Subject: [PATCH] let doxyparse output manpage generation issues
+
+[Backport from upstream commit
+168ee09a4bf184947798c3ee3ac99b6651470d64, fixes the build with Perl
+5.22.]
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ doc/doxyparse.pl | 45 ++++++++++++++++++++++++++++++++++++++-------
+ 1 file changed, 38 insertions(+), 7 deletions(-)
+
+diff --git a/doc/doxyparse.pl b/doc/doxyparse.pl
+index 96a1732..a09b2e8 100755
+--- a/doc/doxyparse.pl
++++ b/doc/doxyparse.pl
+@@ -57,10 +57,15 @@ This manpage was automaticly generated from the ldns source code by
+ use of Doxygen and some perl.
+ ";
+-getopts("m:",\%options);
++getopts("em:",\%options);
+ # if -m manpage file is given process that file
+ # parse the file which tells us what manpages go together
+ my $functions, $see_also;
++my $i = -1;
++my $report_errors = defined $options{'e'};
++my $errors = 0;
++my %unique;
++
+ if (defined $options{'m'}) {
+       # process
+       open(MAN, "<$options{'m'}") or die "Cannot open $options{'m'}";
+@@ -68,18 +73,35 @@ if (defined $options{'m'}) {
+               # func1, func2, .. | see_also1, see_also2, ...
+               while(<MAN>) {
+                       chomp;
++                      $i += 1;
+                       if (/^#/) { next; }
+                       if (/^$/) { next; }
+-                      ($functions, $see_also) = split /[\t ]*\|[\t ]*/, $_;
+-                      #print "{$functions}\n";
+-                      #print "{$see_also}\n";
++                      my @parts = split /[\t ]*\|[\t ]*/, $_;
++                      $functions = shift @parts;
++                      $see_also = join ', ', @parts;
++                      print "{$functions}\n";
++                      print "{$see_also}\n";
+                       my @funcs = split /[\t ]*,[\t ]*/, $functions;
+                       my @also = split /[\t ]*,[\t ]*/, $see_also;
+                       $manpages{$funcs[0]} = \@funcs;
+                       $see_also{$funcs[0]} = \@also;
++                      foreach (@funcs) {
++                              if ($unique{$_}) {
++                                      push $unique{$_}, ($i,);
++                              } else {
++                                      $unique{$_} = [$i];
++                              }
++                      }
+                       #print "[", $funcs[0], "]\n";
+               }
+       close(MAN);
++      while (($func, $lines) = each %unique ) {
++              if (scalar @$lines > 1) {
++                      print STDERR "$func in function_manpages on lines: "
++                          . join(", ",@$lines) . "\n" if $report_errors;
++                      $errors += 1;
++              }
++      }
+ } else {
+       print "Need -m file to process the .h files\n";
+       exit 1;
+@@ -95,7 +117,7 @@ mkdir "doc/man";
+ mkdir "doc/man/man$MAN_SECTION";
+ $state = 0;
+-my $i;
++$i = 0;
+ my @lines = <STDIN>;
+ my $max = @lines;
+@@ -273,7 +295,7 @@ foreach (keys %manpages) {
+       print MAN $MAN_MIDDLE;
+-      if (defined(@$also)) {
++      if (@$also) {
+               print MAN "\n.SH SEE ALSO\n\\fI";
+               print MAN join "\\fR, \\fI", @$also;
+               print MAN "\\fR.\nAnd ";
+@@ -290,7 +312,7 @@ foreach (keys %manpages) {
+       # create symlinks
+       chdir("$BASE/man$MAN_SECTION");
+       foreach (@$name) {
+-              print STDERR $_,"\n";
++              print STDOUT $_,"\n";
+               my $new_file = $_ . "." . $MAN_SECTION;
+               if ($new_file eq $symlink_file) {
+                       next;
+@@ -301,3 +323,12 @@ foreach (keys %manpages) {
+       chdir("../../.."); # and back, tricky and fragile...
+       close(MAN);
+ }
++foreach (keys %api) {
++      next if (/ / || /^$/);
++      if (not $unique{$_}) {
++              print STDERR "no man page for $_\n" if $report_errors;
++              $errors += 1;
++      }
++}
++
++exit ($report_errors and $errors != 0);
+-- 
+2.6.4
+