]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - html/cgi-bin/firewall.cgi
services.cgi: Use new perl system functions
[people/pmueller/ipfire-2.x.git] / html / cgi-bin / firewall.cgi
index 1483e779ff22ba7b8db2c2309f0dc5788e3b3b53..70dee8d3cca38add53dabf0e2aa2607b187bb63b 100644 (file)
@@ -38,11 +38,11 @@ require "${General::swroot}/header.pl";
 require "${General::swroot}/location-functions.pl";
 require "/usr/lib/firewall/firewall-lib.pl";
 
-unless (-d "${General::swroot}/firewall")                      { system("mkdir ${General::swroot}/firewall"); }
-unless (-e "${General::swroot}/firewall/settings")     { system("touch ${General::swroot}/firewall/settings"); }
-unless (-e "${General::swroot}/firewall/config")       { system("touch ${General::swroot}/firewall/config"); }
-unless (-e "${General::swroot}/firewall/input")                { system("touch ${General::swroot}/firewall/input"); }
-unless (-e "${General::swroot}/firewall/outgoing")     { system("touch ${General::swroot}/firewall/outgoing"); }
+unless (-d "${General::swroot}/firewall")                      { &General::system("mkdir", "${General::swroot}/firewall"); }
+unless (-e "${General::swroot}/firewall/settings")     { &General::system("touch", "${General::swroot}/firewall/settings"); }
+unless (-e "${General::swroot}/firewall/config")       { &General::system("touch", "${General::swroot}/firewall/config"); }
+unless (-e "${General::swroot}/firewall/input")                { &General::system("touch", "${General::swroot}/firewall/input"); }
+unless (-e "${General::swroot}/firewall/outgoing")     { &General::system("touch", "${General::swroot}/firewall/outgoing"); }
 
 my %fwdfwsettings=();
 my %selected=() ;
@@ -99,7 +99,7 @@ my $checkorange='';
 my @protocols;
 &General::readhash("${General::swroot}/firewall/settings", \%fwdfwsettings);
 &General::readhash("${General::swroot}/main/settings", \%mainsettings);
-&General::readhash("/srv/web/ipfire/html/themes/".$mainsettings{'THEME'}."/include/colors.txt", \%color);
+&General::readhash("/srv/web/ipfire/html/themes/ipfire/include/colors.txt", \%color);
 &General::readhash($fwoptions, \%optionsfw); 
 &General::readhash($ifacesettings, \%ifaces);
 &General::readhash("$configovpn", \%ovpnsettings);
@@ -1552,6 +1552,11 @@ sub newrule
                                $fwdfwsettings{'USE_NAT'}                               = $hash{$key}[28];
                                $fwdfwsettings{'nat'}                                   = $hash{$key}[31]; #changed order
                                $fwdfwsettings{$fwdfwsettings{'nat'}}   = $hash{$key}[29];
+                               #Fix BUG 12479
+                               #When copying a DNAT Rule, the sourceport has to be empty at this point.
+                               if($hash{$key}[14] eq 'cust_srv' and $hash{$key}[31] eq 'dnat'){
+                                       $hash{$key}[30] = '';
+                               }
                                $fwdfwsettings{'dnatport'}                              = $hash{$key}[30];
                                $fwdfwsettings{'LIMIT_CON_CON'}                 = $hash{$key}[32];
                                $fwdfwsettings{'concon'}                                = $hash{$key}[33];