From 11b75f5dadd9dbca990847a3f336cb9f75374055 Mon Sep 17 00:00:00 2001 From: Juan David Hurtado G Date: Sun, 24 Nov 2024 20:49:06 -0500 Subject: [PATCH] shellcheck errors: SC2068 Double quote array expansions to avoid re-splitting elements. --- usr/local/share/bastille/common.sh | 2 +- usr/local/share/bastille/rdr.sh | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/usr/local/share/bastille/common.sh b/usr/local/share/bastille/common.sh index aef59e38..74c12e67 100644 --- a/usr/local/share/bastille/common.sh +++ b/usr/local/share/bastille/common.sh @@ -58,7 +58,7 @@ error_notify() { # Notify message on error and exit error_exit() { - error_notify $@ + error_notify "$@" exit 1 } diff --git a/usr/local/share/bastille/rdr.sh b/usr/local/share/bastille/rdr.sh index 9e3ebf7b..6bd7fbcd 100644 --- a/usr/local/share/bastille/rdr.sh +++ b/usr/local/share/bastille/rdr.sh @@ -183,21 +183,21 @@ while [ $# -gt 0 ]; do jail_port=$3 shift 3 if [ $# -gt 3 ]; then - for last in $@; do + for last in "$@"; do true done if [ $2 == "(" ] && [ $last == ")" ] ; then check_jail_validity - persist_rdr_log_rule $proto $host_port $jail_port $@ - load_rdr_log_rule $proto $host_port $jail_port $@ + persist_rdr_log_rule $proto $host_port $jail_port "$@" + load_rdr_log_rule $proto $host_port $jail_port "$@" shift $# else usage fi elif [ $# -eq 1 ]; then check_jail_validity - persist_rdr_log_rule $proto $host_port $jail_port $@ - load_rdr_log_rule $proto $host_port $jail_port $@ + persist_rdr_log_rule $proto $host_port $jail_port "$@" + load_rdr_log_rule $proto $host_port $jail_port "$@" shift 1 else usage