Correct shell warnings detected by coverity

This commit is contained in:
Petr Menšík 2022-01-18 12:17:17 +01:00
parent ed2f945c40
commit e20853883a
2 changed files with 5 additions and 5 deletions

View File

@ -15,7 +15,7 @@ fi
# This script generates /etc/rndc.key if doesn't exist AND if there is no rndc.conf # This script generates /etc/rndc.key if doesn't exist AND if there is no rndc.conf
if [ ! -s /etc/rndc.key -a ! -s /etc/rndc.conf ]; then if [ ! -s /etc/rndc.key ] && [ ! -s /etc/rndc.conf ]; then
echo -n $"Generating /etc/rndc.key:" echo -n $"Generating /etc/rndc.key:"
if /usr/sbin/rndc-confgen -a -A hmac-sha256 > /dev/null 2>&1 if /usr/sbin/rndc-confgen -a -A hmac-sha256 > /dev/null 2>&1
then then

View File

@ -10,7 +10,7 @@ usage()
echo 'Usage: setup-named-chroot.sh ROOTDIR <on|off> [chroot.files]' echo 'Usage: setup-named-chroot.sh ROOTDIR <on|off> [chroot.files]'
} }
if ! [ "$#" -ge 2 -a "$#" -le 3 ]; then if ! [ "$#" -ge 2 ] && [ "$#" -le 3 ]; then
echo 'Wrong number of arguments' echo 'Wrong number of arguments'
usage usage
exit 1 exit 1
@ -34,9 +34,9 @@ dev_create()
DEVNAME="$ROOTDIR/dev/$1" DEVNAME="$ROOTDIR/dev/$1"
shift shift
if ! [ -e "$DEVNAME" ]; then if ! [ -e "$DEVNAME" ]; then
/bin/mknod -m 0664 "$DEVNAME" $@ /bin/mknod -m 0664 "$DEVNAME" "$@"
/bin/chgrp named "$DEVNAME" /bin/chgrp named "$DEVNAME"
if [ -x /usr/sbin/selinuxenabled -a -x /sbin/restorecon ]; then if [ -x /usr/sbin/selinuxenabled ] && [ -x /sbin/restorecon ]; then
/usr/sbin/selinuxenabled && /sbin/restorecon "$DEVNAME" > /dev/null || : /usr/sbin/selinuxenabled && /sbin/restorecon "$DEVNAME" > /dev/null || :
fi fi
fi fi
@ -78,7 +78,7 @@ mount_chroot_conf()
else else
# Mount source is a directory. Mount it only if directory in chroot is # Mount source is a directory. Mount it only if directory in chroot is
# empty. # empty.
if [ -e "$all" ] && [ `ls -1A $ROOTDIR$all | wc -l` -eq 0 ]; then if [ -e "$all" ] && [ `ls -1A "$ROOTDIR$all" | wc -l` -eq 0 ]; then
mount --bind --make-private "$all" "$ROOTDIR$all" mount --bind --make-private "$all" "$ROOTDIR$all"
fi fi
fi fi