pf-tools commit: r585 [parmelan-guest] - in /branches/0.32-stable: debian/changelog dumpiplist.pl lib-net

parmelan-guest at users.alioth.debian.org parmelan-guest at users.alioth.debian.org
Mon Mar 10 15:46:54 UTC 2008


Author: parmelan-guest
Date: Mon Mar 10 15:46:54 2008
New Revision: 585

URL: http://svn.debian.org/wsvn/pf-tools/?sc=1&rev=585
Log:
  - Bugfix: correctly handle hosts without shortname definition

Modified:
    branches/0.32-stable/debian/changelog
    branches/0.32-stable/dumpiplist.pl
    branches/0.32-stable/lib-net

Modified: branches/0.32-stable/debian/changelog
URL: http://svn.debian.org/wsvn/pf-tools/branches/0.32-stable/debian/changelog?rev=585&op=diff
==============================================================================
--- branches/0.32-stable/debian/changelog (original)
+++ branches/0.32-stable/debian/changelog Mon Mar 10 15:46:54 2008
@@ -8,8 +8,9 @@
     - Feature: improved dumpiplist.pl
     - Bugfix: Subst_vars() wasn't doing the right thing when %VAR% was used
       but $SUBST{'VAR'} was not defined
-
- -- Thomas Parmelan <tom+pf-tools at ankh.fr.EU.org>  Thu, 06 Mar 2008 17:07:32 +0100
+    - Bugfix: correctly handle hosts without shortname definition
+
+ -- Thomas Parmelan <tom+pf-tools at ankh.fr.EU.org>  Mon, 10 Mar 2008 15:08:59 +0100
 
 pf-tools (0.32.48-1) unstable; urgency=low
 

Modified: branches/0.32-stable/dumpiplist.pl
URL: http://svn.debian.org/wsvn/pf-tools/branches/0.32-stable/dumpiplist.pl?rev=585&op=diff
==============================================================================
--- branches/0.32-stable/dumpiplist.pl (original)
+++ branches/0.32-stable/dumpiplist.pl Mon Mar 10 15:46:54 2008
@@ -29,8 +29,8 @@
 
 use Data::Dumper;
 
+require("lib-conf");
 require("lib-net");
-require("lib-conf");
 require("lib-update");
 
 use Getopt::Long qw ( :config ignore_case_always bundling ) ;

Modified: branches/0.32-stable/lib-net
URL: http://svn.debian.org/wsvn/pf-tools/branches/0.32-stable/lib-net?rev=585&op=diff
==============================================================================
--- branches/0.32-stable/lib-net (original)
+++ branches/0.32-stable/lib-net Mon Mar 10 15:46:54 2008
@@ -749,7 +749,6 @@
 #===================================================================================
 sub Add_server {
     my ( $Z, $S, $srv ) = @_;
-    my $start;
     my $s;
 
     # Calcul de la plage d'adresse alouee et du nombre de serveurs a definir
@@ -1014,6 +1013,7 @@
 
                 my $addr = $Z->{NETWORK}->{BY_NAME}->{$lan}->{network};
 
+		my $start;
 		if ( defined $S->{'ip'}->{$lan}->{$mnamindexnum} ) {
 		    $start = $S->{'ip'}->{$lan}->{$mnamindexnum};
 		}
@@ -1023,7 +1023,7 @@
                 elsif ( defined $S->{ipstart}->{default} ) {
                     $start = $S->{ipstart}->{default};
                 }
-                else {
+                elsif ( defined $S->{shortname} ) {
                     $start = $S->{ipstart}->{ $S->{shortname} };
                 }
 
@@ -1056,7 +1056,7 @@
                 }
 
                 # Definition de l'alias DNS principal
-                if ( $S->{shortname} eq $lan ) {
+                if ( defined $S->{shortname} and $S->{shortname} eq $lan ) {
                     $M->{zone}->{$mnam} = {};
                     $M->{zone}->{$mnam}->{FIELD} = $nam;
                     $M->{zone}->{$mnam}->{TYPE}  = 'CNAME';
@@ -1208,16 +1208,20 @@
     }
 
     # Insertion de la classe de serveurs dans la structure principale
-    if ( defined $S->{ipstart}->{ $S->{shortname} } ) {
-        $start = $S->{ipstart}->{ $S->{shortname} };
-    }
-    else {
-        $start = $S->{ipstart}->{default};
-    }
-
-    $Z->{SERVERS}->{BY_ADDR}
-      ->{ Address( $Z->{NETWORK}->{BY_NAME}->{ $S->{shortname} }->{network},
-          $start, 0 ) } = $N;
+    if ( defined $S->{'shortname'} ) {
+	if ( defined $S->{ipstart}->{ $S->{shortname} } ) {
+	    $start = $S->{ipstart}->{ $S->{shortname} };
+	}
+	else {
+	    $start = $S->{ipstart}->{default};
+	}
+
+	$Z->{SERVERS}->{BY_ADDR}->{ Address( $Z->{NETWORK}->{BY_NAME}->{ $S->{shortname} }->{network}, $start, 0 ) } = $N;
+    }
+#    else {
+#	Warn( $ERR_SYNTAX, "$srv: no shortname defined, so no SERVERS->BY_ADDR definition. Check this is really what you want!" );
+#    }
+
     $Z->{SERVERS}->{BY_NAME}->{$srv} = $N;
 
     # Remapping UM




More information about the pf-tools-commits mailing list