diff --git a/server/CHANGELOG.md b/server/CHANGELOG.md index 80f6568..8909a9f 100644 --- a/server/CHANGELOG.md +++ b/server/CHANGELOG.md @@ -12,6 +12,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +* shell syntax error when ${btrfs_bin} variable is empty + ### Security ## [22.04] - 2022-04-20 diff --git a/server/lib/bkctld-inc-lock b/server/lib/bkctld-inc-lock index e3c704e..8b04e93 100755 --- a/server/lib/bkctld-inc-lock +++ b/server/lib/bkctld-inc-lock @@ -13,7 +13,7 @@ target_path="${2:?}" lock_target() { target="${1:?}" btrfs_bin=$(command -v btrfs) - if [ -z ${btrfs_bin} ]; then + if [ -z "${btrfs_bin}" ]; then error "btrfs not found. Please install btrfs-progs." fi if is_btrfs "${target}"; then @@ -26,7 +26,7 @@ lock_target() { unlock_target() { target="${1:?}" btrfs_bin=$(command -v btrfs) - if [ -z ${btrfs_bin} ]; then + if [ -z "${btrfs_bin}" ]; then error "btrfs not found. Please install brtfs-progs." fi if is_btrfs "${target}"; then diff --git a/server/lib/bkctld-remove b/server/lib/bkctld-remove index f3dc6c3..382bac7 100755 --- a/server/lib/bkctld-remove +++ b/server/lib/bkctld-remove @@ -53,7 +53,7 @@ rm -f "${CONFDIR}/${jail_name}" rm -rf "$(jail_config_dir "${jail_name}")" btrfs_bin=$(command -v btrfs) -if [ -z ${btrfs_bin} ]; then +if [ -z "${btrfs_bin}" ]; then error "btrfs not found. Please install btrfs-progs." fi diff --git a/server/lib/bkctld-rm b/server/lib/bkctld-rm index 28caef8..00451ad 100755 --- a/server/lib/bkctld-rm +++ b/server/lib/bkctld-rm @@ -63,7 +63,7 @@ delete_inc_btrfs() { inc_path=$(inc_path "${jail_name}" "${inc_name}") btrfs_bin=$(command -v btrfs) - if [ -z ${btrfs_bin} ]; then + if [ -z "${btrfs_bin}" ]; then error "btrfs not found. Please install btrfs-progs." fi