From b6cf7699f5cb81e8c584da477b8e84a232d8d06a Mon Sep 17 00:00:00 2001 From: teastep Date: Wed, 20 Jun 2007 23:33:40 +0000 Subject: [PATCH] Make install more foolproof; don't include services from odd-ball protocols git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6631 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/buildports.pl | 2 ++ Shorewall-perl/install.sh | 7 ++++++- Shorewall-perl/shorewall-perl.spec | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Shorewall-perl/buildports.pl b/Shorewall-perl/buildports.pl index 4ba660b9b..cecb06cb2 100755 --- a/Shorewall-perl/buildports.pl +++ b/Shorewall-perl/buildports.pl @@ -131,6 +131,8 @@ while ( read_a_line1 ) { my ( $number, $proto ) = split '/', $proto_number; + next unless $proto eq 'tcp' || $proto eq 'udp'; + print_service( $name1 , $number ); while ( defined ( $name1 = shift @names ) && $name1 ne '-' ) { diff --git a/Shorewall-perl/install.sh b/Shorewall-perl/install.sh index c799964fb..538de64e9 100755 --- a/Shorewall-perl/install.sh +++ b/Shorewall-perl/install.sh @@ -31,6 +31,7 @@ usage() # $1 = exit status echo " $ME -v" echo " $ME -h" echo " $ME -n" + echo " $ME -n -P" exit $1 } @@ -110,6 +111,7 @@ if [ -z "$GROUP" ] ; then fi NOBACKUP= +INSTALL_PORTS_PM=Yes while [ $# -gt 0 ] ; do case "$1" in @@ -123,6 +125,9 @@ while [ $# -gt 0 ] ; do -n) NOBACKUP=Yes ;; + -P) + INSTALL_PORTS_PM= + ;; *) usage 1 ;; @@ -190,7 +195,7 @@ done # install_file buildports.pl ${PREFIX}/usr/share/shorewall-perl/buildports.pl 0555 -[ -z "$PREFIX" ] && ./buildports.pl > /usr/share/shorewall-perl/Shorewall/Ports.pm && chmod 0555 /usr/share/shorewall-perl/Shorewall/Ports.pm +[ -n "$INSTALL_PORTS_PM" ] && ./buildports.pl > /usr/share/shorewall-perl/Shorewall/Ports.pm && chmod 0555 /usr/share/shorewall-perl/Shorewall/Ports.pm echo $VERSION > ${PREFIX}/usr/share/shorewall-perl/version # diff --git a/Shorewall-perl/shorewall-perl.spec b/Shorewall-perl/shorewall-perl.spec index 5f9f6b7f2..11ea56a05 100644 --- a/Shorewall-perl/shorewall-perl.spec +++ b/Shorewall-perl/shorewall-perl.spec @@ -37,7 +37,7 @@ compilation and execution. export PREFIX=$RPM_BUILD_ROOT ; \ export OWNER=`id -n -u` ; \ export GROUP=`id -n -g` ;\ -./install.sh -n +./install.sh -n -P %clean rm -rf $RPM_BUILD_ROOT