diff --git a/nss-mdns-config b/nss-mdns-config index d66c00d..f0e3c01 100644 --- a/nss-mdns-config +++ b/nss-mdns-config @@ -37,7 +37,7 @@ NSSWITCH=/etc/nsswitch.conf -function usage() { +usage() { echo "nss-mdns-config [--enable|--disable] [-4|-6] [--no-backup]" } @@ -101,11 +101,11 @@ if test "$ENABLE" -ne 1 -a "$DISABLE" -ne 1; then ENABLED=0 for ITEM in $VALUE; do - if test "$ITEM" == "mdns4_minimal" -o "$ITEM" == "mdns4"; then + if [ "$ITEM" = "mdns4_minimal" -o "$ITEM" = "mdns4" ]; then IPv4_ENABLED=1 - elif test "$ITEM" == "mdns6_minimal" -o "$ITEM" == "mdns6"; then + elif [ "$ITEM" = "mdns6_minimal" -o "$ITEM" = "mdns6" ]; then IPv6_ENABLED=1 - elif test "$ITEM" == "mdns_minimal" -o "$ITEM" == "mdns"; then + elif [ "$ITEM" = "mdns_minimal" -o "$ITEM" = "mdns" ]; then ENABLED=1 fi done @@ -128,11 +128,11 @@ elif test "$DISABLE" -eq 1; then DROPACTION=0 for ITEM in $VALUE; do - if test \( "$ITEM" == "mdns4_minimal" -o "$ITEM" == "mdns4" \) -a "$IPv4" -eq 1; then + if [ "$ITEM" = "mdns4_minimal" -o "$ITEM" = "mdns4" ] && [ "$IPv4" -eq 1 ]; then DROPACTION=1 - elif test \( "$ITEM" == "mdns6_minimal" -o "$ITEM" == "mdns6" \) -a "$IPv6" -eq 1; then + elif [ "$ITEM" = "mdns6_minimal" -o "$ITEM" = "mdns6" ] && [ "$IPv6" -eq 1 ]; then DROPACTION=1 - elif test "$ITEM" == "mdns_minimal" -o "$ITEM" == "mdns"; then + elif [ "$ITEM" = "mdns_minimal" -o "$ITEM" = "mdns" ]; then if test "$IPvALL" -eq 1; then DROPACTION=1 elif test "$IPv4" -eq 1; then @@ -145,7 +145,7 @@ elif test "$DISABLE" -eq 1; then echo "Internal error when disabling $ITEM." exit 1 fi - elif test "${ITEM::1}" == "[" -a "$DROPACTION" -eq 1; then + elif [ "${ITEM#[}" != "$ITEM" -a "$DROPACTION" -eq 1 ]; then DROPACTION=0 else NEWVALUE="$NEWVALUE $ITEM" @@ -168,20 +168,20 @@ elif test "$ENABLE" -eq 1; then DROPACTION=0 for ITEM in $VALUE; do - if test \( "$ITEM" == "mdns_minimal" -o "$ITEM" == "mdns4_minimal" -o "$ITEM" == "mdns6_minimal" \); then + if [ "$ITEM" = "mdns_minimal" -o "$ITEM" = "mdns4_minimal" -o "$ITEM" = "mdns6_minimal" ]; then if test "$FOUND_DNS" -eq 1; then # don't keep *_minimal after dns; it's not desired there DROPACTION=1 else - if test "$IPvALL" -eq 1 -a \( "$ITEM" == "mdns4_minimal" -o "$ITEM" == "mdns6_minimal" \); then + if [ "$IPvALL" -eq 1 ] && [ "$ITEM" = "mdns4_minimal" -o "$ITEM" = "mdns6_minimal" ]; then # no need to keep mdns[46]_minimal since we'll add mdns_minimal DROPACTION=1 else - if test "$ITEM" == "mdns_minimal"; then + if [ "$ITEM" = "mdns_minimal" ]; then FOUND=1 - elif test "$ITEM" == "mdns4_minimal" -a "$IPv4" -eq 1; then + elif [ "$ITEM" = "mdns4_minimal" -a "$IPv4" -eq 1 ]; then FOUND=1 - elif test "$ITEM" == "mdns6_minimal" -a "$IPv6" -eq 1; then + elif [ "$ITEM" = "mdns6_minimal" -a "$IPv6" -eq 1 ]; then FOUND=1 fi # force the use of [NOTFOUND=return] after *_minimal @@ -189,10 +189,10 @@ elif test "$ENABLE" -eq 1; then DROPACTION=1 fi fi - elif test \( "$ITEM" == "mdns" -o "$ITEM" == "mdns4" -o "$ITEM" == "mdns6" \); then + elif [ "$ITEM" = "mdns" -o "$ITEM" = "mdns4" -o "$ITEM" = "mdns6" ]; then # we simply don't use the non-minimal version in our setup, so drop it DROPACTION=1 - elif test "$ITEM" == "dns"; then + elif [ "$ITEM" = "dns" ]; then FOUND_DNS=1 DROPACTION=0 if test "$FOUND" -ne 1; then @@ -210,7 +210,7 @@ elif test "$ENABLE" -eq 1; then else NEWVALUE="$NEWVALUE $ITEM" fi - elif test "${ITEM::1}" == "[" -a "$DROPACTION" -eq 1; then + elif [ "${ITEM#[}" != "$ITEM" -a "$DROPACTION" -eq 1 ]; then DROPACTION=0 else NEWVALUE="$NEWVALUE $ITEM" diff --git a/nss-mdns.changes b/nss-mdns.changes index dd6b938..1d69c61 100644 --- a/nss-mdns.changes +++ b/nss-mdns.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Oct 18 20:14:00 UTC 2014 - Led + +- fix bashisms in nss-mdns-config + ------------------------------------------------------------------- Mon Apr 15 13:34:44 UTC 2013 - idonmez@suse.com diff --git a/nss-mdns.spec b/nss-mdns.spec index e5dd8cf..f4fda52 100644 --- a/nss-mdns.spec +++ b/nss-mdns.spec @@ -1,7 +1,7 @@ # # spec file for package nss-mdns # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed