[exim-cvs] Testsuite: teach the fakedns zonefile generator a…

Top Pagina
Delete this message
Reply to this message
Auteur: Exim Git Commits Mailing List
Datum:  
Aan: exim-cvs
Onderwerp: [exim-cvs] Testsuite: teach the fakedns zonefile generator about the ipv6 double-colon rule.
Gitweb: http://git.exim.org/exim.git/commitdiff/6f99d4d9e2854bcb934dca52930d90435584d291
Commit:     6f99d4d9e2854bcb934dca52930d90435584d291
Parent:     0a3df1d651b9e11c7c91bf095aebaf8c65d6c276
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Sun May 6 23:12:03 2012 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Sun May 6 23:12:03 2012 +0100


    Testsuite: teach the fakedns zonefile generator about the ipv6 double-colon rule.


    Fixes case 1003 for me (having a trailing ::).
---
 test/runtest |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)


diff --git a/test/runtest b/test/runtest
index 69c6931..d42d400 100755
--- a/test/runtest
+++ b/test/runtest
@@ -598,7 +598,7 @@ RESET_AFTER_EXTRA_LINE_READ:
   # Handle only the Gnu and MacOS space, dot, plus and at-sign.  A full [[:graph:]]
   # unfortunately matches a non-ls linefull of dashes.
   # Allow the case where we've already picked out the file protection bits.
-  if (s/^([-d](?:[-r][-w][-SsTtx]){3})[.+@]?( +|$)/\1\2/) {
+  if (s/^([-d](?:[-r][-w][-SsTtx]){3})[.+@]?( +|$)/$1$2/) {
     s/ +/ /g;
   }


@@ -2947,7 +2947,16 @@ if ($have_ipv4 && $parm_ipv4 ne "127.0.0.1")

 if ($have_ipv6 && $parm_ipv6 ne "::1")
   {
-  my(@components) = split /:/, $parm_ipv6;
+  my($exp_v6) = $parm_ipv6;
+  $exp_v6 =~ s/[^:]//g;
+  if ( $parm_ipv6 =~ /^([^:].+)::$/ ) {
+    $exp_v6 = $1 . ':0' x (9-length($exp_v6));
+  } elsif ( $parm_ipv6 =~ /^(.+)::(.+)$/ ) {
+    $exp_v6 = $1 . ':0' x (8-length($exp_v6)) . ':' . $2;
+  } elsif ( $parm_ipv6 =~ /^::(.+[^:])$/ ) {
+    $exp_v6 = '0:' x (9-length($exp_v6)) . $1;
+  }
+  my(@components) = split /:/, $exp_v6;
   my(@nibbles) = reverse (split /\s*/, shift @components);
   my($sep) =  "";