diff --git a/Shorewall-common/changelog.txt b/Shorewall-common/changelog.txt index 09435414f..777da5059 100644 --- a/Shorewall-common/changelog.txt +++ b/Shorewall-common/changelog.txt @@ -8,6 +8,8 @@ Changes in 4.1.8 4) Add the -p option to start and stop +5) Allow installers to run under Cygwin without extra parameters. + Changes in 4.1.7 1) Fix port verification. diff --git a/Shorewall-common/install.sh b/Shorewall-common/install.sh index 129eeb9fb..e758be00a 100755 --- a/Shorewall-common/install.sh +++ b/Shorewall-common/install.sh @@ -149,13 +149,24 @@ if [ -z "$RUNLEVELS" ] ; then RUNLEVELS="" fi -if [ -z "$OWNER" ] ; then - OWNER=root -fi +DEBIAN= +CYGWIN= -if [ -z "$GROUP" ] ; then - GROUP=root -fi +case $(uname) in + CYGWIN*) + DEST= + INIT= + OWNER=$(id -un) + GROUP=$(id -gn) + CYGWIN=Yes + ;; + *) + [ -z "$OWNER" ] && OWNER=root + [ -z "$GROUP" ] && GROUP=root + ;; +esac + +OWNERSHIP="-o $OWNER -g $GROUP" NOBACKUP= @@ -184,35 +195,29 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin # # Determine where to install the firewall script # -DEBIAN= -CYGWIN= - -OWNERSHIP="-o $OWNER -g $GROUP" if [ -n "$PREFIX" ]; then - if [ `id -u` != 0 ] ; then - echo "Not setting file owner/group permissions, not running as root." - OWNERSHIP="" - fi + if [ -z "$CYGWIN" -a `id -u` != 0 ] ; then + echo "Not setting file owner/group permissions, not running as root." + OWNERSHIP="" install -d $OWNERSHIP -m 755 ${PREFIX}/sbin install -d $OWNERSHIP -m 755 ${PREFIX}${DEST} + fi else [ -x /usr/share/shorewall-shell/compiler -o -x /usr/share/shorewall-perl/compiler.pl ] || \ { echo " ERROR: No Shorewall compiler is installed" >&2; exit 1; } - if [ -d /etc/apt -a -e /usr/bin/dpkg ]; then - DEBIAN=yes - elif [ -f /etc/slackware-version ] ; then - DEST="/etc/rc.d" - INIT="rc.firewall" - elif [ -f /etc/arch-release ] ; then - DEST="/etc/rc.d" - INIT="shorewall" - ARCHLINUX=yes - elif [ -d /cygdrive ]; then - DEST= - INIT= - CYGWIN=yes + if [ -z "$CYGWIN" ]; then + if [ -d /etc/apt -a -e /usr/bin/dpkg ]; then + DEBIAN=yes + elif [ -f /etc/slackware-version ] ; then + DEST="/etc/rc.d" + INIT="rc.firewall" + elif [ -f /etc/arch-release ] ; then + DEST="/etc/rc.d" + INIT="shorewall" + ARCHLINUX=yes + fi fi fi diff --git a/Shorewall-common/releasenotes.txt b/Shorewall-common/releasenotes.txt index 8a209dbf8..f74b38811 100644 --- a/Shorewall-common/releasenotes.txt +++ b/Shorewall-common/releasenotes.txt @@ -101,6 +101,10 @@ Other Changes in Shoreall 4.1.8. c) The arithmetic operators +-* and /. d) The word 'full'. +2) The installers (install.sh) now auto-detect a Cygwin environment + and install under the current user's ID if OWNER and GROUP are not + given. + New Features in Shorewall 4.1. 1) Shorewall 4.1 contains support for multiple Internet providers @@ -380,17 +384,23 @@ New Features in Shorewall 4.1. traffic by MARK value. Previously, Shorewall used the CLASSIFY target in the POSTROUTING chain if it was available. -14) The Shorewall-common installer (install.sh) now works on Windows - under Cygwin. +14) The Shorewall installers (install.sh) now work on Windows + under Cygwin. By default, they install under the user id and group + of the person doing the install. This can be overridden by + specifying OWNER and GROUP explicitly. + + Example: + + OWNER=foo GROUP=bar ./install.sh To install Shorewall-perl under Cygwin: $ tar -zxf shorewall-perl-4.x.y.tar.bz2 $ tar -zxf shorewall-common-4.x.y.tar.bz2 $ cd shorewall-perl-4.x.y - $ USER= GROUP=None ./install.sh + $ ./install.sh $ cd ../shorewall-common-4.x.y - $ USER= GROUP=None ./install.sh + $ ./install.sh The 'shorewall' program is installed in /bin/ (a.k.a, /usr/bin/). diff --git a/Shorewall-perl/install.sh b/Shorewall-perl/install.sh index 7ea437355..5de72b511 100755 --- a/Shorewall-perl/install.sh +++ b/Shorewall-perl/install.sh @@ -102,13 +102,18 @@ if [ -z "$RUNLEVELS" ] ; then RUNLEVELS="" fi -if [ -z "$OWNER" ] ; then - OWNER=root -fi - -if [ -z "$GROUP" ] ; then - GROUP=root -fi +case $(uname) in + CYGWIN*) + DEST= + INIT= + OWNER=$(id -un) + GROUP=$(id -gn) + ;; + *) + [ -z "$OWNER" ] && OWNER=root + [ -z "$GROUP" ] && GROUP=root + ;; +esac NOBACKUP= diff --git a/Shorewall-shell/install.sh b/Shorewall-shell/install.sh index d1453aba9..d3209054a 100755 --- a/Shorewall-shell/install.sh +++ b/Shorewall-shell/install.sh @@ -149,13 +149,18 @@ if [ -z "$RUNLEVELS" ] ; then RUNLEVELS="" fi -if [ -z "$OWNER" ] ; then - OWNER=root -fi - -if [ -z "$GROUP" ] ; then - GROUP=root -fi +case $(uname) in + CYGWIN*) + DEST= + INIT= + [ -z "$OWNER" ] && OWNER=$(id -un) + [ -z "$GROUP" ] && GROUP=$(id -gn) + ;; + *) + [ -z "$OWNER" ] && OWNER=root + [ -z "$GROUP" ] && GROUP=root + ;; +esac NOBACKUP= @@ -184,7 +189,6 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:/usr/local/sbin # # Determine where to install the firewall script # -DEBIAN= OWNERSHIP="-o $OWNER -g $GROUP"