Diff for /loncom/configuration/Firewall.pm between versions 1.1 and 1.5

version 1.1, 2009/06/10 23:51:51 version 1.5, 2009/07/17 00:15:49
Line 76  sub firewall_open_port { Line 76  sub firewall_open_port {
                     &firewall_close_anywhere($iptables,$fw_chain,$port);                      &firewall_close_anywhere($iptables,$fw_chain,$port);
                     foreach my $key (keys(%{$iphost})) {                      foreach my $key (keys(%{$iphost})) {
                         my $ip = '';                          my $ip = '';
                         if ($key =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/) {                            if (($1<=255) && ($2<=255) && ($3<=255) && ($4<=255)) {                          if ($key =~ /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/) {
                               if (($1<=255) && ($2<=255) && ($3<=255) && ($4<=255)) {
                                 $ip = "$1.$2.$3.$4";                                  $ip = "$1.$2.$3.$4";
                             } else {                              } else {
                                 next;                                  next;
Line 293  sub get_lond_port { Line 294  sub get_lond_port {
 }  }
   
 sub get_fw_chain {  sub get_fw_chain {
       my ($iptables) = @_;
     my $fw_chain = 'RH-Firewall-1-INPUT';      my $fw_chain = 'RH-Firewall-1-INPUT';
     my $suse_config = "/etc/sysconfig/SuSEfirewall2";      my $suse_config = "/etc/sysconfig/SuSEfirewall2";
     if (-e $suse_config) {      if (-e $suse_config) {
         $fw_chain = 'input_ext';          $fw_chain = 'input_ext';
     } else {      } else {
         if (!-e '/etc/sysconfig/iptables') {          if (!-e '/etc/sysconfig/iptables') {
             print("Unable to find iptables file containing static definitions\n");              if (!-e '/var/lib/iptables') {
                   print("Unable to find iptables file containing static definitions\n");
               }
           }
           if ($iptables eq '') {
               $iptables = &get_pathto_iptables();
           }
           my $count = `$iptables -L -n 2>/dev/null |grep $fw_chain |wc -l`;
           chomp($count);
           if (!$count) {
               $fw_chain ='INPUT';
         }          }
     }      }
     return $fw_chain;      return $fw_chain;

Removed from v.1.1  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>