From d022671ddf05b3e4e5b0bb816cc7b120c083e6f2 Mon Sep 17 00:00:00 2001 From: Vadim Kurland Date: Tue, 21 Oct 2008 03:21:32 +0000 Subject: [PATCH] * dns.cpp (list): (change in libfwbuilder) getHostByName() used to insert duplicate IP addresses into the list of the results. Now making sure ip addresses in the result are unique. --- build_num | 2 +- doc/ChangeLog | 6 +++++- test/ipf/quick-cmp.sh | 25 +++++++++---------------- test/ipf/run.all | 22 +++++++--------------- test/ipfw/quick-cmp.sh | 21 ++++++++------------- test/ipfw/run.all | 22 +++++++--------------- 6 files changed, 37 insertions(+), 61 deletions(-) diff --git a/build_num b/build_num index 6386cd867..fa788e2e1 100644 --- a/build_num +++ b/build_num @@ -1 +1 @@ -#define BUILD_NUM 623 +#define BUILD_NUM 624 diff --git a/doc/ChangeLog b/doc/ChangeLog index 2763d12fa..34d61161b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,6 +1,10 @@ 2008-10-20 vadim - * Compiler.cpp (Compiler::_expand_addr_recursive): ) change in + * dns.cpp (list): (change in libfwbuilder) getHostByName() used to + insert duplicate IP addresses into the list of the results. Now + making sure ip addresses in the result are unique. + + * Compiler.cpp (Compiler::_expand_addr_recursive): (change in libfwbuilder) change in the algorithm used to decide which interfaces of the host or firewall object to use in a rule when this host or firewall object is found in source or diff --git a/test/ipf/quick-cmp.sh b/test/ipf/quick-cmp.sh index c6aa7f2c3..5a57224d2 100755 --- a/test/ipf/quick-cmp.sh +++ b/test/ipf/quick-cmp.sh @@ -1,19 +1,12 @@ -#!/usr/bin/perl - -$XMLFILE=@ARGV[0]; - -$DIFFCMD="diff -C 1 -b -B -c -I \"# Generated\" -I 'Activating ' -I '# Firewall Builder fwb_ipf v' "; +#!/bin/sh -while (<>) { - $str=$_; - while ( $str=~ /]+name="([^"]*).*$"/; - $fw=$1; - printf "$DIFFCMD %s.fw.orig %s.fw\n",$fw,$fw; - printf "$DIFFCMD %s-ipf.conf.orig %s-ipf.conf\n",$fw,$fw; - printf "$DIFFCMD %s-nat.conf.orig %s-nat.conf\n",$fw,$fw; - $str=~ s/^.*]+name="$fw"[^>]+>//; - } -} +XMLFILE=$1 +DIFFCMD="diff -C 1 -c -b -B -I \"# Generated\" -I 'Activating ' -I '# Firewall Builder fwb_ipt v' -I 'Can not find file' -I '====' -I 'log '" + +fwbedit list -f $XMLFILE -o /User/Firewalls -c -F%name% | sort | while read fwobj; do + echo "$DIFFCMD ${fwobj}.fw.orig ${fwobj}.fw" + echo "$DIFFCMD ${fwobj}-ipf.conf.orig ${fwobj}-ipf.conf" + echo "$DIFFCMD ${fwobj}-nat.conf.orig ${fwobj}-nat.conf" +done diff --git a/test/ipf/run.all b/test/ipf/run.all index 294f64810..1844ab186 100755 --- a/test/ipf/run.all +++ b/test/ipf/run.all @@ -1,18 +1,10 @@ -#!/usr/bin/perl +#!/bin/sh -$XMLFILE=@ARGV[0]; - - -while (<>) { - $str=$_; - while ( $str=~ /]+name="([^"]*).*$"/; - $fw=$1; - printf "\n"; - printf "echo '******* $fw'\n"; - printf "fwb_ipf -v -f $XMLFILE -xt $fw\n"; - $str=~ s/^.*]+name="$fw"[^>]+>//; - } -} +XMLFILE=$1 +fwbedit list -f $XMLFILE -o /User/Firewalls -c -F%name% | sort | while read fwobj; do + echo "echo" + echo "echo \"============================ $fwobj\"" + echo "fwb_ipf -v -f $XMLFILE -xt $fwobj" +done diff --git a/test/ipfw/quick-cmp.sh b/test/ipfw/quick-cmp.sh index 194a96e11..dd5609090 100755 --- a/test/ipfw/quick-cmp.sh +++ b/test/ipfw/quick-cmp.sh @@ -1,15 +1,10 @@ -#!/usr/bin/perl +#!/bin/sh -$XMLFILE=@ARGV[0]; -$DIFFCMD="diff -C 1 -b -B -c -I \"# Generated\" -I 'Activating ' -I '# Firewall Builder fwb_ipfw v' "; - -while (<>) { - $str=$_; - while ( $str=~ /]+name="([^"]*).*$"/; - $fw=$1; - printf "$DIFFCMD %s.fw.orig %s.fw\n",$fw,$fw; - $str=~ s/^.*]+name="$fw"[^>]+>//; - } -} +XMLFILE=$1 +DIFFCMD="diff -C 5 -c -b -B -I \"# Generated\" -I 'Activating ' -I '# Firewall Builder fwb_ipt v' -I 'Can not find file' -I '====' -I 'log '" + +fwbedit list -f $XMLFILE -o /User/Firewalls -c -F%name% | sort | while read fwobj; do + echo "$DIFFCMD ${fwobj}.fw.orig ${fwobj}.fw" +done + diff --git a/test/ipfw/run.all b/test/ipfw/run.all index b12f77a8b..23cfd2a5a 100755 --- a/test/ipfw/run.all +++ b/test/ipfw/run.all @@ -1,18 +1,10 @@ -#!/usr/bin/perl +#!/bin/sh -$XMLFILE=@ARGV[0]; - - -while (<>) { - $str=$_; - while ( $str=~ /]+name="([^"]*).*$"/; - $fw=$1; - printf "\n"; - printf "echo '********* $fw'\n"; - printf "fwb_ipfw -v -f $XMLFILE $fw\n"; - $str=~ s/^.*]+name="$fw"[^>]+>//; - } -} +XMLFILE=$1 +fwbedit list -f $XMLFILE -o /User/Firewalls -c -F%name% | sort | while read fwobj; do + echo "echo" + echo "echo \"============================ $fwobj\"" + echo "fwb_ipfw -v -f $XMLFILE -xt $fwobj" +done