Forward Firewall: Fixed Bug: When deleting a rule, only the last entry in the list...
authorAlexander Marx <amarx@ipfire.org>
Thu, 3 Jan 2013 12:29:35 +0000 (13:29 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 9 Aug 2013 12:05:22 +0000 (14:05 +0200)
html/cgi-bin/forwardfw.cgi

index 1f5ea0044dbbc007a8855707c97dbd2635634af7..caaba21687f45a046f76a3e6d0cb48e0d4327851 100755 (executable)
@@ -512,6 +512,7 @@ sub deleterule
        my %delhash=();
        &General::readhasharray($fwdfwsettings{'config'}, \%delhash);
        foreach my $key (sort keys %delhash){
+               
                if ($key eq $fwdfwsettings{'key'}){
                        #check hosts/net and groups
                        &checkcounter($delhash{$key}[3],$delhash{$key}[4],,);
@@ -521,11 +522,10 @@ sub deleterule
                                &checkcounter($delhash{$key}[14],$delhash{$key}[15],,);
                        }
                }
-               
                if ($key ge $fwdfwsettings{'key'}) {
                        my $next = $key + 1;
                        if (exists $delhash{$next}) {
-                               foreach my $i (0 .. $#{$configfwdfw{$next}}) {
+                               foreach my $i (0 .. $#{$delhash{$next}}) {
                                        $delhash{$key}[$i] = $delhash{$next}[$i];
                                }
                        }
@@ -537,6 +537,7 @@ sub deleterule
 
        &General::writehasharray($fwdfwsettings{'config'}, \%delhash);
        &rules;
+       
        if($fwdfwsettings{'nobase'} ne 'on'){
                &base;
        }