Harden the locking mechanism
[openresolv] / named.in
index 2083ea52058dba95d206fec6f08db0f780ec68a9..3301896416bb215f5a8356e44ae6ee4eefac425b 100644 (file)
--- a/named.in
+++ b/named.in
@@ -1,5 +1,5 @@
 #!/bin/sh
 #!/bin/sh
-# Copyright (c) 2007-2016 Roy Marples
+# Copyright (c) 2007-2020 Roy Marples
 # All rights reserved
 
 # named subscriber for resolvconf
 # All rights reserved
 
 # named subscriber for resolvconf
 
 [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0
 . "@SYSCONFDIR@/resolvconf.conf" || exit 1
 
 [ -f "@SYSCONFDIR@"/resolvconf.conf ] || exit 0
 . "@SYSCONFDIR@/resolvconf.conf" || exit 1
-[ -z "$named_zones" -a -z "$named_options" ] && exit 0
+[ -z "${named_zones}${named_options}" ] && exit 0
 [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)"
 NL="
 "
 
 # Platform specific kludges
 [ -z "$RESOLVCONF" ] && eval "$(@SBINDIR@/resolvconf -v)"
 NL="
 "
 
 # Platform specific kludges
-if [ -z "$named_service" -a -z "$named_restart" -a \
-       -d "$RCDIR" -a ! -x "$RCDIR"/named ]
+if [ -z "${named_service}${named_restart}" ] &&
+   [ -d "$RCDIR" ] && ! [ -x "$RCDIR"/named ]
 then
        if [ -x "$RCDIR"/bind9 ]; then
                # Debian and derivatives
 then
        if [ -x "$RCDIR"/bind9 ]; then
                # Debian and derivatives
@@ -111,7 +111,7 @@ if $changed; then
                eval $named_restart
        elif [ -n "$RESTARTCMD" ]; then
                set -- ${named_service}
                eval $named_restart
        elif [ -n "$RESTARTCMD" ]; then
                set -- ${named_service}
-               eval $RESTARTCMD
+               eval "$RESTARTCMD"
        else
                @SBINDIR@/resolvconf -r ${named_service}
        fi
        else
                @SBINDIR@/resolvconf -r ${named_service}
        fi