From 0facff3a0129ebe2a42cd4a8c20cea5fa420ef0d Mon Sep 17 00:00:00 2001 From: Robin Schneider Date: Tue, 14 Mar 2017 20:10:26 +0100 Subject: [PATCH 1/2] Fix handling of binds containing spaces ```bash binds+=( '/etc/tmp/s s' ) ``` was handled incorrectly before. --- vm-systemd/bind-dirs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vm-systemd/bind-dirs.sh b/vm-systemd/bind-dirs.sh index 9a6b393..33ffd95 100755 --- a/vm-systemd/bind-dirs.sh +++ b/vm-systemd/bind-dirs.sh @@ -55,7 +55,7 @@ bind_dirs() { ## ro: read-only ## rw: read-write - for fso_ro in ${binds[@]}; do + for fso_ro in "${binds[@]}"; do local symlink_level_counter symlink_level_counter="0" From a205c86bfea609f8783c7f85a25c6e5aa499667e Mon Sep 17 00:00:00 2001 From: Robin Schneider Date: Tue, 14 Mar 2017 20:13:23 +0100 Subject: [PATCH 2/2] Fix more shellcheck warnings --- vm-systemd/bind-dirs.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vm-systemd/bind-dirs.sh b/vm-systemd/bind-dirs.sh index 33ffd95..824c4fe 100755 --- a/vm-systemd/bind-dirs.sh +++ b/vm-systemd/bind-dirs.sh @@ -25,7 +25,7 @@ # along with this program. If not, see . # Source Qubes library. -. /usr/lib/qubes/init/functions +source /usr/lib/qubes/init/functions prerequisite() { if ! is_rwonly_persistent ; then @@ -111,6 +111,7 @@ main() { bind_dirs "$@" } +binds=() for source_folder in /usr/lib/qubes-bind-dirs.d /etc/qubes-bind-dirs.d /rw/config/qubes-bind-dirs.d ; do true "source_folder: $source_folder" if [ ! -d "$source_folder" ]; then @@ -118,6 +119,7 @@ for source_folder in /usr/lib/qubes-bind-dirs.d /etc/qubes-bind-dirs.d /rw/confi fi for file_name in "$source_folder/"*".conf" ; do bash -n "$file_name" + # shellcheck source=/dev/null source "$file_name" done done