Package: firehol
Version: 1.273-1
Severity: normal
Tags: patch

The patch Adrian Bridgett attached to this bug possibly applies to some
older version of the package.  The patch attached here
(get-iana.583176.patch) applies to the current unstable version.

The second attached patch, posixification (get-iana.posix.patch), possibly
closes even bug#496424.  The 'checkbashisms' script reported:

possible bashism in get-iana.sh.shebang line 71 ($RANDOM):
tempfile="/tmp/iana.$$.$RANDOM"
possible bashism in get-iana.sh.shebang line 117 ('$[' should be '$(('):
                        x=$[x + 1]
possible bashism in get-iana.sh.shebang line 137 ('$[' should be '$(('):
        i=$[i + 1]

The second patch fixes that.

FWIW, get-iana does the job, but it's more of a mess than I expected :(

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages firehol depends on:
ii  bash                          4.1-3      The GNU Bourne Again SHell
ii  iproute                       20100519-3 networking and traffic control too
ii  iptables                      1.4.9-1    administration tools for packet fi
ii  lsb-base                      3.2-23.1   Linux Standard Base 3.2 init scrip
ii  net-tools                     1.60-23    The NET-3 networking toolkit

Versions of packages firehol recommends:
ii  aggregate                     1.6-6      ipv4 cidr prefix aggregator
ii  curl                          7.21.1-1   Get a file from an HTTP, HTTPS or
ii  module-init-tools             3.12-1     tools for managing Linux kernel mo
ii  wget                          1.12-2     retrieves files from the web

Versions of packages firehol suggests:
ii  ulogd                         1.24-3     The Netfilter Userspace Logging Da

-- Configuration Files:
/etc/default/firehol changed:
START_FIREHOL=YES
WAIT_FOR_IFACE="eth0"

/etc/firehol/RESERVED_IPS [Errno 13] Permission denied: 
u'/etc/firehol/RESERVED_IPS'
/etc/firehol/firehol.conf [Errno 13] Permission denied: 
u'/etc/firehol/firehol.conf'

-- no debconf information

Cheers,

-- 
Cristian
--- /usr/sbin/get-iana	2009-11-14 22:40:37.000000000 +0100
+++ get-iana	2010-08-28 11:47:19.000000000 +0200
@@ -56,7 +56,7 @@
 # and creates a list with all reserved address spaces.
 #
 
-IPV4_ADDRESS_SPACE_URL="http://www.iana.org/assignments/ipv4-address-space";
+IPV4_ADDRESS_SPACE_URL="http://www.iana.org/assignments/ipv4-address-space/ipv4-address-space.txt";
 
 # The program will match all rows in the file which start with a number, have a slash,
 # followed by another number, for which the following pattern will also match on the
@@ -92,9 +92,8 @@
 echo >&2
 
 wget -O - --proxy=off "${IPV4_ADDRESS_SPACE_URL}"	|\
-	egrep "^[0-9]+/[0-9]+.*${IANA_RESERVED}"	|\
 	egrep -vi "${IANA_IGNORE}"			|\
-	cut -d ' ' -f 1					|\
+	sed -rne "s#^[[:blank:]]*([0-9]+/[0-9]+).*${IANA_RESERVED}.*#\1#p" |\
 (
 	
 	while IFS="/" read range net
--- get-iana.~2~	2010-08-28 12:24:20.000000000 +0200
+++ get-iana	2010-08-28 12:22:58.000000000 +0200
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 # $Id: get-iana.sh,v 1.12 2008/03/17 22:08:43 ktsaou Exp $
 #
@@ -68,7 +68,13 @@
 #IANA_IGNORE="(Multicast|Private use|Loopback|Local Identification)"
 IANA_IGNORE="Multicast"
 
-tempfile="/tmp/iana.$$.$RANDOM"
+tempfile=$(mktemp -t ${0##*/}.XXXXXXXXXX) || {
+	echo >&2
+	echo >&2 "ERROR"
+	echo >&2 "Failed to create a temporary file."
+	echo >&2
+	exit 1
+}
 
 AGGREGATE="`which aggregate 2>/dev/null`"
 if [ -z "${AGGREGATE}" ]
@@ -114,7 +120,7 @@
 		do
 			# test $x -ne 127 && echo "$x.0.0.0/$net"
 			echo "$x.0.0.0/$net"
-			x=$[x + 1]
+			x=$((x + 1))
 		done
 	done
 ) | \
@@ -134,7 +140,7 @@
 i=0
 for x in `cat ${tempfile}`
 do
-	i=$[i + 1]
+	i=$((i + 1))
 	printf "${x} "
 done
 printf "\"\n"

Reply via email to