pf-tools commit: r666 [ccaillet-guest] - in /trunk: debian/changelog lib/PFTools/Net.pm

parmelan-guest at users.alioth.debian.org parmelan-guest at users.alioth.debian.org
Fri Oct 24 10:01:56 UTC 2008


Author: ccaillet-guest
Date: Fri Oct 24 10:01:55 2008
New Revision: 666

URL: http://svn.debian.org/wsvn/pf-tools/?sc=1&rev=666
Log:
Avoid warnings and fix Resolv into Net.pm introduced by factorization from
Get_Host_Props

Modified:
    trunk/debian/changelog
    trunk/lib/PFTools/Net.pm

Modified: trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pf-tools/trunk/debian/changelog?rev=666&op=diff
==============================================================================
--- trunk/debian/changelog (original)
+++ trunk/debian/changelog Fri Oct 24 10:01:55 2008
@@ -12,8 +12,10 @@
   * Avoid a possible warning on mk_sourceslist 
   * Forward port fix r655 from branches/0.33-stable
   * Forward port fix an enhancement r658 from branches/0.33-stable
-
- -- Christophe Caillet <quadchris at free.fr>  Wed, 08 Oct 2008 16:59:02 +0200
+  * Avoid warnings and fix Resolv into Net.pm introduced by factorization from
+    Get_Host_Props
+
+ -- Christophe Caillet <quadchris at free.fr>  Thu, 23 Oct 2008 17:37:35 +0200
 
 pf-tools (0.33.1-1) unstable; urgency=low
 

Modified: trunk/lib/PFTools/Net.pm
URL: http://svn.debian.org/wsvn/pf-tools/trunk/lib/PFTools/Net.pm?rev=666&op=diff
==============================================================================
--- trunk/lib/PFTools/Net.pm (original)
+++ trunk/lib/PFTools/Net.pm Fri Oct 24 10:01:55 2008
@@ -166,7 +166,7 @@
 sub Get_Host_Props ($$) {
     my ( $Z, $host ) = @_ ;
 
-    $host =~ /^([^.]+)(\.([^.]+))?\.$Z->{SOA}->{name}$/ ;
+    $host =~ /^([^.]+)(\.([^.]+))?(\.$Z->{SOA}->{name})?$/ ;
     my ( $hostshort, $hostvlan ) = ( $1, $3 ) ;
     return undef if ( ! defined $hostshort ) ;
 
@@ -639,9 +639,9 @@
 sub Get_dns_from_hostname {
     my ( $Z, $host ) = @_;
 
-    $host =~ /^([^.]+)(\.([^.]+))?\.$Z->{SOA}->{name}$/ ;
+    $host =~ m/^([^.]+)(\.([^.]+))?(\.$Z->{SOA}->{name})?$/ ;
     my $hostnum = $1 ;
-    $hostnum =~ /.*([\d]+)$/ ;
+    $hostnum =~ s/.*([\d]+)$/$1/ ;
     my $M = Get_Host_Props ( $Z, $host ) ;
 
     return Get_dns_from_zone( $Z, $M, $hostnum );
@@ -1807,9 +1807,11 @@
     my $i;
     my $j;
 
-    $host =~ /^([^.]+)(\.([^.]+))?\.$Z->{SOA}->{name}$/ ;
-    my ( $host2, $hostshort, $hostvlan ) = ( $1.$2, $1, $3 ) ;
-    my $M = Get_Host_Props ( $Z, $host ) ;
+    my $host2 = $host ;
+    $host2 =~ s/\.$Z->{SOA}->{name}// ;
+    my ( $hostshort, $hostvlan ) = split ( /\./, $host2 ) ;
+    if ( ! defined ) { $hostvlan = "" ; }
+    my $M = Get_Host_Props ( $Z, $host2 ) ;
 
     if ( defined( $M->{'zone'}->{$host2}->{'FIELD'} ) ) {
 	if ( $M->{'zone'}->{$host2}->{'TYPE'} eq "CNAME" ) {




More information about the pf-tools-commits mailing list