Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 04 May 2011 11:07:17 +0900
From:      KIRIYAMA Kazuhiko <kiri@pis.elm.toba-cmt.ac.jp>
To:        freebsd-stable@freebsd.org
Subject:   Re: /etc/rc.d/ipfw can't deal with firewall_type?
Message-ID:  <201105040207.p4427Hs1055072@pis.elm.toba-cmt.ac.jp>
In-Reply-To: <201105040140.p441eClM054591@pis.elm.toba-cmt.ac.jp>
References:  <BANLkTik8cAOt1iAP1tOu0EVrRL07uHA8Ng@mail.gmail.com> <201105031543.p43Fh92T041708@pis.elm.toba-cmt.ac.jp> <20110504030404.O85801@sola.nimnet.asn.au> <201105040140.p441eClM054591@pis.elm.toba-cmt.ac.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
At Wed, 04 May 2011 10:40:12 +0900,
My wrote:
> 
> At Wed, 4 May 2011 03:47:02 +1000 (EST),
> Ian Smith wrote:
> > 
> >  > +++ /etc/rc.d/ipfw	2011-05-03 22:08:14.000000000 +0900
> >  > @@ -35,15 +35,11 @@
> >  >  
> >  >  ipfw_start()
> >  >  {
> >  > -	local   _firewall_type
> >  > -
> >  > -	_firewall_type=$1
> >  > -
> >  >  	# set the firewall rules script if none was specified
> >  >  	[ -z "${firewall_script}" ] && firewall_script=/etc/rc.firewall
> >  >  
> >  >  	if [ -r "${firewall_script}" ]; then
> >  > -		/bin/sh "${firewall_script}" "${_firewall_type}"
> >  > +		/bin/sh "${firewall_script}" "${firewall_type}"
> >  >  		echo 'Firewall rules loaded.'
> >  >  	elif [ "`ipfw list 65535`" = "65535 deny ip from any to any" ]; then
> >  >  		echo 'Warning: kernel has firewall functionality, but' \
> 
> For the case of commandline usage, above patch should be modified as
> follows:
> 
> --- /etc/rc.d/ipfw.org	2011-05-03 18:19:28.000000000 +0900
> +++ /etc/rc.d/ipfw	2011-05-04 09:31:09.000000000 +0900
> @@ -37,7 +37,11 @@
>  {
>  	local   _firewall_type
>  
> -	_firewall_type=$1
> +	if [ -n "${1}" ]; then
> +		_firewall_type=$1
> +	elif [ -n "${firewall_type}" ]
> +		_firewall_type=${firewall_type}
> +	fi	
>  
>  	# set the firewall rules script if none was specified
>  	[ -z "${firewall_script}" ] && firewall_script=/etc/rc.firewall

Above patch has typo. Collect one is as follows:

--- /etc/rc.d/ipfw.org	2011-05-03 18:19:28.000000000 +0900
+++ /etc/rc.d/ipfw	2011-05-04 09:53:40.000000000 +0900
@@ -37,7 +37,11 @@
 {
 	local   _firewall_type
 
-	_firewall_type=$1
+	if [ -n "${1}" ]; then
+		_firewall_type=$1
+	elif [ -n "${firewall_type}" ]; then
+		_firewall_type=${firewall_type}
+	fi	
 
 	# set the firewall rules script if none was specified
 	[ -z "${firewall_script}" ] && firewall_script=/etc/rc.firewall



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105040207.p4427Hs1055072>