From 3b7f948896440f41092f14347b17ce114072c569 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 7 Jun 2022 15:58:34 +0200 Subject: [PATCH] grml_chroot: fix broken mount argument handling Commit b4a4893b0b6 broke behavior of the grml-chroot script, as it then passed all mount options as single argument, which then fails: | + all_options_='-t proc none' | + mount '-t proc none' /mnt/proc | mount: /mnt/proc: can't find in /etc/fstab. | + mountit sysfs sys | [...] Convert mount options into an array, to properly work also with quotes. --- usr_sbin/grml-chroot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/usr_sbin/grml-chroot b/usr_sbin/grml-chroot index 8fcdabf..b13b57e 100755 --- a/usr_sbin/grml-chroot +++ b/usr_sbin/grml-chroot @@ -43,14 +43,14 @@ function mountit local dest_="$2" local options_="$3" - local all_options_="" + local all_options_=() if [[ $options_ == "--bind" ]]; then - all_options_="--bind $type_" + all_options_+=(--bind "$type_") else - all_options_="-t $type_ none" + all_options_+=(-t "$type_" none) fi - mount "$all_options_" "${DEST_}/$dest_" && storeMounts "$dest_" + mount "${all_options_[@]}" "${DEST_}/$dest_" && storeMounts "$dest_" } function umount_all -- 2.1.4