[dnssec-tools/f17: 17/18] patches needed for building

Wes Hardaker hardaker at fedoraproject.org
Thu Jan 3 23:19:59 UTC 2013


commit b6071fc63c8e0f0f08d2798f4cd5f10d95c84534
Author: Wes Hardaker <opensource at hardakers.net>
Date:   Thu Jan 3 15:18:55 2013 -0800

    patches needed for building

 dnssec-tools-1.13-zonesigner-soa-rewrite.patch |  414 ++++++++++++++++++++++++
 dnssec-tools-zonefile-fast-fixes-1.14.patch    |   44 +++
 2 files changed, 458 insertions(+), 0 deletions(-)
---
diff --git a/dnssec-tools-1.13-zonesigner-soa-rewrite.patch b/dnssec-tools-1.13-zonesigner-soa-rewrite.patch
new file mode 100644
index 0000000..a90855d
--- /dev/null
+++ b/dnssec-tools-1.13-zonesigner-soa-rewrite.patch
@@ -0,0 +1,414 @@
+Index: zonesigner
+===================================================================
+--- zonesigner	(.../tags/dnssec-tools-1.13/tools/scripts/zonesigner)	(revision 7302)
++++ zonesigner	(.../trunk/dnssec-tools/tools/scripts/zonesigner)	(revision 7302)
+@@ -1,6 +1,6 @@
+ #!/usr/bin/perl
+ #
+-# Copyright 2004-2012 SPARTA, Inc.  All rights reserved.  See the COPYING
++# Copyright 2004-2013 SPARTA, Inc.  All rights reserved.  See the COPYING
+ # file distributed with this software for details.
+ #
+ # DNSSEC-Tools:  zonesigner
+@@ -54,8 +54,8 @@
+ # Version information.
+ #
+ my $NAME   = "zonesigner";
+-my $VERS   = "$NAME version: 1.13.0";
+-my $DTVERS = "DNSSEC-Tools Version: 1.13";
++my $VERS   = "$NAME version: 1.13.2";
++my $DTVERS = "DNSSEC-Tools Version: 1.14";
+ 
+ #
+ # Verbose values.
+@@ -2785,9 +2785,16 @@
+ # Routine:	serialincr
+ #
+ # Purpose:	This routine increments the serial number of an SOA record in
+-#		a zone file.  The serial number is found in both the multi-line
+-#		parenthesized form and the single line unparenthesized form.
++#		a previously opened zone file.  The serial number is found in
++#		both the multi-line parenthesized form and the single line
++#		unparenthesized form.
+ #
++#		serialincr() isn't an an all-purpose SOA parser.  It is
++#		sufficient for finding the SOA serial number and updated
++#		*just* the serial number without changing anything else.
++#		It does not ensure the parens are balanced or check validity
++#		of other fields. 
++#
+ #		The SOA line is searched for, line by line.  There are three
+ #		basic formats of interest:
+ #			- serial number on SOA line, without parentheses
+@@ -2795,166 +2802,248 @@
+ #			- serial number not on SOA line, with parentheses
+ #
+ #		Getting the old serial number and setting the new serial
+-#		number maintain the existing format and any comments that
+-#		may be on the line.
++#		number maintain the existing format and any comments that may
++#		be on the line.  The only difference between the "before" SOA
++#		line and the "after" SOA line is the changed serial number.
+ #
+ #		On success, the new serial number is returned.
+ #		On failure, -1 is returned.
+ #
+ sub serialincr
+ {
+-	my $file = "";				# Contents of zone file.
+-	my @lines = ();				# Contents of zone file.
++	my $file;				# Contents string of zone file.
++	my @lines = ();				# Contents array of zone file.
++	my $soare;				# SOA regular expression.
+ 
+-	my $serialnum = -1;			# Current serial number.
+-	my $serialnew;				# New serial number.
++	my $serialnew = -1;			# New serial number.
+ 
+ 	#
+-	# Get the zone's current serial number.
+-	#
+-	$serialnum = $opts{'serial'} if(defined($opts{'serial'}));
+-
+-	#
+ 	# Get the zonefile's contents.
+ 	#
+ 	seek(ZF,0,0);
+ 	@lines = <ZF>;
+ 
+ 	#
++	# This regular expression will find the IN SOA line in the zone
++	# file.  It handles parenthesess, spacing, and no spacing.  When
++	# used, it matches everything from the beginning of the line to
++	# the SOA, plus any trailing lparens and spacing.  It will also
++	# handle the optional name and TTL from the beginning of the line.
++	# Gaze in wonder upon this testament to pattern matching.
++	#
++	$soare = '^.*?[ \t\(\)]+IN[ \t\(\)]+SOA[ \t\(\)]+';
++
++	#
+ 	# Find the SOA line and components.
+ 	#
+ 	for(my $ind = 0; $ind < @lines; $ind++)
+ 	{
+-		my $line = $lines[$ind];		# Current line.
++		my $line = $lines[$ind];	# Line under consideration.
++		my $lncp = $line;		# Copy of the line.  *Only*
++						# used in finding an SOA line.
+ 
+ 		#
+-		# Delete the comment portion of the line.
++		# Skip comments and empty lines.
+ 		#
+-		$line =~ s/;.*$//;
++		if(($line =~ /^[ \t\(\)]*$/) || ($line =~ /^[ \t\(\)]*;/))
++		{
++			next;
++		}
+ 
+ 		#
+-		# If this line isn't an SOA, go to the next line.
++		# Skip this line if it isn't an SOA line.  We'll dump any
++		# comments from the copy for the sake of checking for the SOA.
+ 		#
+-		next if($line !~ /IN\s+SOA/i);
++		$lncp =~ s/;.*$//;
++		next if($lncp !~ /$soare/i);
+ 
+ 		#
+-		# If the line has a left paren, it may be a multiline SOA.
+-		# If it doesn't, the the SOA is all on one line.
++		# If this line has a left paren, we'll treat this as a multi-
++		# line SOA.  If the serial number isn't here, then we'll look
++		# on subsequent lines.
+ 		#
+ 		if($line =~ /\(/)
+ 		{
+-			my $preline;			# Line before serial.
+-			my $postline;			# Line after serial.
++			my $ln = '';		# Modified line.
++			my $datacnt = 0;	# Count of SOA data we've seen.
++			my @chgrps;		# Line's non-whitespace groups.
++			my @spgrps;		# Line's whitespace groups.
+ 
+ 			#
+-			# Recover the original -- possibly commented -- line
+-			# and split it at the left paren.
++			# Split the line into the IN SOA marker chunk and the
++			# chunk of whatever follows.  The latter will be
++			# searched for the serial number; the former will be
++			# saved for (potential) later use.
+ 			#
+-			$line = $lines[$ind];
+-			$line =~ /^(.*?\()(.*)/;
+-			$preline = $1;
+-			$postline = $2;
++			$line =~ /$soare/i;
++			$ln	= $&;
++			$line	= $';
+ 
+ 			#
+-			# If the line's post-paren part has a number, we'll
+-			# take that as the serial number.
+-			# If it doesn't, we'll keep looking through the
+-			# zonefile's lines until we find the next line with
+-			# a number.
++			# Keep looking through lines until we find the serial
++			# number or EOF.
+ 			#
+-			if($postline =~ /(\d+)/)
++			while($ind < @lines)
+ 			{
+-				my $serial;
++				my $found = 0;	# Serial-number-found flag.
+ 
+-				$serial = $1;
+-				$serialnew = $serial;
++				#
++				# Skip comment and blank lines.
++				#
++				if(($line =~ /^[ \t\(\)]*$/) ||
++				   ($line =~ /^[ \t\(\)]*;/))
++				{
++					last if($ind == @lines);
++					$line = $lines[++$ind];
++					$ln = '';
++					next;
++				}
+ 
+ 				#
+-				# Increment the larger serial number of the
+-				# one in the zonefile and the keyrec file.
++				# Break the line up into its pieces, dividing
++				# up the character blobs and whitespace blobs.
++				# We'll be interleaving these anon.
+ 				#
+-				$serialnew = $serialnum if($serialnum > $serialnew);
+-				$serialnew++;
++				@chgrps = split /[\s\(\)]+/, $line;
++				@spgrps = split /[^\s\(\)]+/, $line;
+ 
+ 				#
+-				# Build the line.
++				# Dump any initial null elements from the
++				# two blob arrays.
+ 				#
+-				$postline =~ s/$serial/$serialnew/;
+-				$lines[$ind] = $preline . $postline . "\n";
++				shift @spgrps if($spgrps[0] eq '');
++				shift @chgrps if($chgrps[0] eq '');
+ 
+-			}
+-			else
+-			{
+ 				#
+-				# Look through each line for the next
+-				# line-with-a-number.
++				# Now we'll look through the line's tokens.  The
++				# serial number is the third non-parenthesis
++				# token on a SOA line after the SOA token, so
++				# we've got to look until we find the 3rd token.
++				# We're going to account for parens, multiple
++				# lines, comments, and whitespace.
+ 				#
+-				for(; $ind < @lines; $ind++)
++				for(my $grind=0; $grind < @chgrps; $grind++)
+ 				{
+-					my $line = $lines[$ind];
+-					my $serial;
++					my $datum = $chgrps[$grind];	# Token.
++					my $comment = 0;	# Comment found.
++					my $comstr = '';	# Comment str.
+ 
+-					#
+-					# Delete the comment portion of line.
+-					#
+-					$line =~ s/;.*$//;
++					next if($datum eq '');
+ 
+ 					#
+-					# Skip this line if it has no numbers.
++					# Handle a mid-line comment.
++					# If this token starts with the comment
++					# character, we'll go to the next line.
++					# If not, we'll handle the non-comment
++					# portion of this token and then go to
++					# the next line.  The comment portion
++					# will be saved and re-added later.
+ 					#
+-					next if($line !~ /\d/);
++					if($datum =~ /;/)
++					{
++						$datum =~ /;.*$/;
++						$comstr = $&;
+ 
++						$datum =~ s/;.*$//;
++						$comment = 1;
++						last if(length($datum) == 0);
++					}
++
+ 					#
+-					# Get the first number from the line.
++					# Increment our token count.
+ 					#
+-					$line =~ /(\d+)/;
+-					$serial = $1;
+-					$serialnew = $1;
++					$datacnt++;
+ 
+ 					#
+-					# Increment the larger serial number
+-					# of the one in the zonefile and the
+-					# keyrec file.
++					# If this is the third SOA token (after
++					# the SOA, of course), then it's the
++					# current serial number.  We'll adjust
++					# it, save it, and mark it found.
+ 					#
+-					$serialnew = $serialnum if($serialnum > $serialnew);
+-					$serialnew++;
++					if($datacnt == 3)
++					{
++						$serialnew = serialfix($chgrps[$grind]);
++						$chgrps[$grind] = $serialnew .
++								  $comstr;
+ 
++						$found = 1;
++						last;
++					}
++
+ 					#
+-					# Adjust the serial number in the
+-					# actual zonefile line and drop out
+-					# of the loop.
++					# Stop looking at this line if we found
++					# a comment character in this token.
+ 					#
+-					$lines[$ind] =~ s/$serial/$serialnew/;
+-					last;
++					last if($comment);
+ 				}
++
++				#
++				# Stop looking at this zone file if we found
++				# the serial number.
++				#
++				last if($found);
++
++				#
++				# On to the next line and reset the line buffer.
++				#
++				$line = $lines[++$ind];
++				$ln = '';
+ 			}
++
++			#
++			# Rebuild the line.  The ordering depends on if the
++			# line started with whitespace or non-whitespace.
++			#
++			if($line =~ /^\S/)
++			{
++				while(@chgrps)
++				{
++					$ln .= shift(@chgrps) . shift(@spgrps);
++				}
++			}
++			else
++			{
++				while(@chgrps)
++				{
++					$ln .= shift(@spgrps) . shift(@chgrps);
++				}
++			}
++
++
++			#
++			# Return the rebuilt line to the file-contents array.
++			# This is only done for the serial-number line.  We'll
++			# also add a newline if it doesn't have one already.
++			#
++			$ln .= "\n" if($ln !~ /\n$/);
++			$lines[$ind] = $ln;
++			$ln = '';
+ 		}
+ 		else
+ 		{
+ 			#
+ 			# Get the pieces of the line.
+ 			#
+-			$line =~ /^(.*?\s+IN\s+SOA\s+\S+\s+\S+\s+)(\d+)(.*)/;
+-			$serialnew = $2;
++			$line =~ /^(.*?([0-9]+[smhdw]?)?\s+IN\s+SOA\s+\S+\s+\S+\s+)(\d+)(.*)/i;
++			$serialnew = $3;
+ 
+ 			#
+ 			# Increment the larger serial number of the one in
+ 			# the zonefile and the keyrec file.
+ 			#
+-			$serialnew = $serialnum if($serialnum > $serialnew);
+-			$serialnew++;
++			$serialnew = serialfix($serialnew);
+ 
+ 			#
+ 			# Build the new line.
+ 			#
+-			$lines[$ind] = $1 . $serialnew . $3 . "\n";
++			$lines[$ind] = $1 . $serialnew . $4 . "\n";
+ 
+ 		}
+ 
+ 		#
+-		# We've found the SOA line, so we'll drop out.
++		# Drop out if we've found the serial number.
+ 		#
+-		last;
++		last if($serialnew != -1);
+ 	}
+ 
+ 	#
+@@ -2987,6 +3076,36 @@
+ }
+ 
+ #----------------------------------------------------------------------
++# Routine:	serialfix()
++#
++# Purpose:	Get the *real* new serial number.  We'll compare the zone
++#		file's idea of the serial number to the keyrec's idea and
++#		use the greater of the two.  And increment it by one.
++#		This is only called by serialincr().
++#
++sub serialfix
++{
++	my $serialnew = shift;			# Potential new serial number.
++	my $serialnum = -1;			# Current serial number.
++
++	#
++	# Get the zone's current serial number.
++	#
++	$serialnum = $opts{'serial'} if(defined($opts{'serial'}));
++
++	#
++	# Use the keyrec's idea of the serial number if it's greater than the
++	# serial number in the zone file.
++	#
++	$serialnew = $serialnum if($serialnum > $serialnew);
++
++	#
++	# Return the new serial number incremented by one.
++	#
++	return($serialnew + 1);
++}
++
++#----------------------------------------------------------------------
+ # Routine:	chkkrf()
+ #
+ # Purpose:	If we have a new keyrec file, we'll add a new keyrec
+@@ -5276,7 +5395,7 @@
+ 
+ =head1 COPYRIGHT
+ 
+-Copyright 2004-2012 SPARTA, Inc.  All rights reserved.
++Copyright 2004-2013 SPARTA, Inc.  All rights reserved.
+ See the COPYING file included with the DNSSEC-Tools package for details.
+ 
+ =head1 AUTHOR
diff --git a/dnssec-tools-zonefile-fast-fixes-1.14.patch b/dnssec-tools-zonefile-fast-fixes-1.14.patch
new file mode 100644
index 0000000..82e754a
--- /dev/null
+++ b/dnssec-tools-zonefile-fast-fixes-1.14.patch
@@ -0,0 +1,44 @@
+Index: Fast.pm
+===================================================================
+--- Fast.pm	(revision 7286)
++++ Fast.pm	(working copy)
+@@ -46,7 +46,7 @@
+ use Net::DNS::RR;
+ use MIME::Base64;
+ 
+-$VERSION = '1.17';
++$VERSION = '1.18';
+ 
+ my $MAXIMUM_TTL = 0x7fffffff;
+ 
+@@ -61,7 +61,7 @@
+ # dots in usernames.  Keeping the original version here for easy reference.
+ #
+ # my $pat_maybefullname = qr{[-\w\$\d\/*]+(?:\.[-\w\$\d\/]+)*\.?};
+-my $pat_maybefullname   = qr{[-\w\$\d\/*\\]+(?:\.[-\w\$\d\/]+)*\.?};
++my $pat_maybefullname   = qr{[-\+\w\$\d\/*\\]+(?:\.[-\+\w\$\d\/]+)*\.?};
+ 
+ my $debug;
+ my $domain;
+@@ -198,8 +198,7 @@
+ 	      $z->{mbox} = uc $z->{mbox} if defined $z->{mbox};
+ 	      $z->{txtdname} = uc $z->{txtdname} if defined $z->{txtdname};
+ 	  }
+-	  my $newrec = 
+-	    Net::DNS::RR->new_from_hash(%$z);
++	  my $newrec = Net::DNS::RR->new(%$z);
+ 
+ 	  if ($newrec->{'type'} eq 'DNSKEY') {
+ 	      if (ref($newrec) ne 'Net::DNS::RR::DNSKEY') {
+Index: t/rrs.t
+===================================================================
+--- t/rrs.t	(revision 7286)
++++ t/rrs.t	(working copy)
+@@ -52,6 +52,7 @@
+ 	 q{. IN SOA dns1.acme.com hostmaster.acme.com. ( 1 1 1 1 1 )},
+ 	 q{. IN SOA dns1 hostmaster. ( 1 1 1 1 1 )},
+ 	 q{. IN SOA @ hostmaster.acme.com. ( 1 1 1 1 1 )},
++	 q{. IN SOA @ hostmaster+foo.acme.com. ( 1 1 1 1 1 )},
+ 	 q{acme.com. IN AAAA 2001:688:0:102::1:2},
+ 	 q{acme.com. IN AAAA 2001:688:0:102::3},
+ 	 q{acme.com. IN RP abuse.acme.com. acme.com.},


More information about the scm-commits mailing list