BUG11805: Firewallrule with source orange and target firewall-interface-orange not possible

Message ID 20180822092316.25418-1-alexander.marx@ipfire.org
State Superseded
Headers
Series BUG11805: Firewallrule with source orange and target firewall-interface-orange not possible |

Commit Message

Alexander Marx Aug. 22, 2018, 7:23 p.m. UTC
  From: Alexander Marx <amarx@ipfire.org>

Now its possible to create a rule with orange source and target orange interface of the firewall.

fixes: #11805

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
---
 html/cgi-bin/firewall.cgi | 4 ----
 lfs/apcupsd               | 2 +-
 2 files changed, 1 insertion(+), 5 deletions(-)
  

Comments

Michael Tremer Aug. 22, 2018, 8:14 p.m. UTC | #1
Hi,

On Wed, 2018-08-22 at 11:23 +0200, Alexander Marx wrote:
> From: Alexander Marx <amarx@ipfire.org>
> 
> Now its possible to create a rule with orange source and target orange interface of the firewall.
> 
> fixes: #11805
> 
> Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
> ---
>  html/cgi-bin/firewall.cgi | 4 ----
>  lfs/apcupsd               | 2 +-
>  2 files changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi
> index 499f279d1..fb1c25dfd 100644
> --- a/html/cgi-bin/firewall.cgi
> +++ b/html/cgi-bin/firewall.cgi
> @@ -241,10 +241,6 @@ if ($fwdfwsettings{'ACTION'} eq 'saverule')
>  			$checkorange='on';
>  		}
>  	}
> -	#check useless rules
> -	if(	($fwdfwsettings{$fwdfwsettings{'grp1'}} eq 'ORANGE' || $checkorange eq 'on') && $fwdfwsettings{'grp2'} eq 'ipfire'){
> -		$errormessage.=$Lang::tr{'fwdfw useless rule'}."<br>";
> -	}

Does this exist for any other zones, too?

>  	#check if we try to break rules
>  	if(	$fwdfwsettings{'grp1'} eq 'ipfire_src' && $fwdfwsettings{'grp2'} eq 'ipfire'){
>  		$errormessage=$Lang::tr{'fwdfw err same'};
> diff --git a/lfs/apcupsd b/lfs/apcupsd
> index ce36c3c6f..773dace74 100644
> --- a/lfs/apcupsd
> +++ b/lfs/apcupsd
> @@ -78,7 +78,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
>  	@$(PREBUILD)
>  	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
>  	cd $(DIR_APP) && ./configure --prefix=/usr --enable-usb --enable-cgi \
> -					--with-cgi-bin=/srv/web/ipfire/cgi-bin
> +					--with-cgi-bin=/srv/web/ipfire/cgi-bin --sysconfdir=/var/ipfire/ups

This doesn't belong here.

>  	cd $(DIR_APP) && make $(MAKETUNING)
>  	cd $(DIR_APP) && make install
>
  
Alexander Marx Aug. 22, 2018, 10:24 p.m. UTC | #2
Am 22.08.2018 um 12:14 schrieb Michael Tremer:
> Hi,
>
> On Wed, 2018-08-22 at 11:23 +0200, Alexander Marx wrote:
>> From: Alexander Marx <amarx@ipfire.org>
>>
>> Now its possible to create a rule with orange source and target orange interface of the firewall.
>>
>> fixes: #11805
>>
>> Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
>> ---
>>  html/cgi-bin/firewall.cgi | 4 ----
>>  lfs/apcupsd               | 2 +-
>>  2 files changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi
>> index 499f279d1..fb1c25dfd 100644
>> --- a/html/cgi-bin/firewall.cgi
>> +++ b/html/cgi-bin/firewall.cgi
>> @@ -241,10 +241,6 @@ if ($fwdfwsettings{'ACTION'} eq 'saverule')
>>  			$checkorange='on';
>>  		}
>>  	}
>> -	#check useless rules
>> -	if(	($fwdfwsettings{$fwdfwsettings{'grp1'}} eq 'ORANGE' || $checkorange eq 'on') && $fwdfwsettings{'grp2'} eq 'ipfire'){
>> -		$errormessage.=$Lang::tr{'fwdfw useless rule'}."<br>";
>> -	}
> Does this exist for any other zones, too?
No. Thats the only point in code where a useless rule is checked
>
>>  	#check if we try to break rules
>>  	if(	$fwdfwsettings{'grp1'} eq 'ipfire_src' && $fwdfwsettings{'grp2'} eq 'ipfire'){
>>  		$errormessage=$Lang::tr{'fwdfw err same'};
>> diff --git a/lfs/apcupsd b/lfs/apcupsd
>> index ce36c3c6f..773dace74 100644
>> --- a/lfs/apcupsd
>> +++ b/lfs/apcupsd
>> @@ -78,7 +78,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
>>  	@$(PREBUILD)
>>  	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
>>  	cd $(DIR_APP) && ./configure --prefix=/usr --enable-usb --enable-cgi \
>> -					--with-cgi-bin=/srv/web/ipfire/cgi-bin
>> +					--with-cgi-bin=/srv/web/ipfire/cgi-bin --sysconfdir=/var/ipfire/ups
> This doesn't belong here.
right. Please ignore this part.
>
>>  	cd $(DIR_APP) && make $(MAKETUNING)
>>  	cd $(DIR_APP) && make install
>>
  
Michael Tremer Aug. 22, 2018, 11:45 p.m. UTC | #3
On Wed, 2018-08-22 at 14:24 +0200, Alexander Marx wrote:
> 
> Am 22.08.2018 um 12:14 schrieb Michael Tremer:
> > Hi,
> > 
> > On Wed, 2018-08-22 at 11:23 +0200, Alexander Marx wrote:
> > > From: Alexander Marx <amarx@ipfire.org>
> > > 
> > > Now its possible to create a rule with orange source and target orange interface of the firewall.
> > > 
> > > fixes: #11805
> > > 
> > > Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
> > > ---
> > >  html/cgi-bin/firewall.cgi | 4 ----
> > >  lfs/apcupsd               | 2 +-
> > >  2 files changed, 1 insertion(+), 5 deletions(-)
> > > 
> > > diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi
> > > index 499f279d1..fb1c25dfd 100644
> > > --- a/html/cgi-bin/firewall.cgi
> > > +++ b/html/cgi-bin/firewall.cgi
> > > @@ -241,10 +241,6 @@ if ($fwdfwsettings{'ACTION'} eq 'saverule')
> > >  			$checkorange='on';
> > >  		}
> > >  	}
> > > -	#check useless rules
> > > -	if(	($fwdfwsettings{$fwdfwsettings{'grp1'}} eq 'ORANGE' || $checkorange eq 'on') && $fwdfwsettings{'grp2'} eq 'ipfire'){
> > > -		$errormessage.=$Lang::tr{'fwdfw useless rule'}."<br>";
> > > -	}
> > 
> > Does this exist for any other zones, too?
> 
> No. Thats the only point in code where a useless rule is checked

Well, it is actually not that useless :)

Best,
-Michael

> > 
> > >  	#check if we try to break rules
> > >  	if(	$fwdfwsettings{'grp1'} eq 'ipfire_src' && $fwdfwsettings{'grp2'} eq 'ipfire'){
> > >  		$errormessage=$Lang::tr{'fwdfw err same'};
> > > diff --git a/lfs/apcupsd b/lfs/apcupsd
> > > index ce36c3c6f..773dace74 100644
> > > --- a/lfs/apcupsd
> > > +++ b/lfs/apcupsd
> > > @@ -78,7 +78,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
> > >  	@$(PREBUILD)
> > >  	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
> > >  	cd $(DIR_APP) && ./configure --prefix=/usr --enable-usb --enable-cgi \
> > > -					--with-cgi-bin=/srv/web/ipfire/cgi-bin
> > > +					--with-cgi-bin=/srv/web/ipfire/cgi-bin --sysconfdir=/var/ipfire/ups
> > 
> > This doesn't belong here.
> 
> right. Please ignore this part.
> > 
> > >  	cd $(DIR_APP) && make $(MAKETUNING)
> > >  	cd $(DIR_APP) && make install
> > >  
> 
>
  

Patch

diff --git a/html/cgi-bin/firewall.cgi b/html/cgi-bin/firewall.cgi
index 499f279d1..fb1c25dfd 100644
--- a/html/cgi-bin/firewall.cgi
+++ b/html/cgi-bin/firewall.cgi
@@ -241,10 +241,6 @@  if ($fwdfwsettings{'ACTION'} eq 'saverule')
 			$checkorange='on';
 		}
 	}
-	#check useless rules
-	if(	($fwdfwsettings{$fwdfwsettings{'grp1'}} eq 'ORANGE' || $checkorange eq 'on') && $fwdfwsettings{'grp2'} eq 'ipfire'){
-		$errormessage.=$Lang::tr{'fwdfw useless rule'}."<br>";
-	}
 	#check if we try to break rules
 	if(	$fwdfwsettings{'grp1'} eq 'ipfire_src' && $fwdfwsettings{'grp2'} eq 'ipfire'){
 		$errormessage=$Lang::tr{'fwdfw err same'};
diff --git a/lfs/apcupsd b/lfs/apcupsd
index ce36c3c6f..773dace74 100644
--- a/lfs/apcupsd
+++ b/lfs/apcupsd
@@ -78,7 +78,7 @@  $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
 	@$(PREBUILD)
 	@rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE)
 	cd $(DIR_APP) && ./configure --prefix=/usr --enable-usb --enable-cgi \
-					--with-cgi-bin=/srv/web/ipfire/cgi-bin
+					--with-cgi-bin=/srv/web/ipfire/cgi-bin --sysconfdir=/var/ipfire/ups
 	cd $(DIR_APP) && make $(MAKETUNING)
 	cd $(DIR_APP) && make install