From 74a664194602edf042b38869858e5a601e7f91dd Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 28 Mar 2019 16:54:09 -0400 Subject: Escape paths with ":" that are passed to systemd-nspawn --bind When parsing paths to automatically make available to the container, the ":" is used internally by systemd-nspawn to signify destinations in the container. Replace automatically with "\:" for the mounts that we set up, in order to safely handle a working directory etc. that contains this character. For bind options exposed to the user, it is assumed the user takes care of passing systemd-nspawn compatible paths themselves. Fixes FS#60845 Signed-off-by: Eli Schwartz Signed-off-by: Levente Polyak --- arch-nspawn.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch-nspawn.in') diff --git a/arch-nspawn.in b/arch-nspawn.in index 5bc8e79..fb2b53e 100644 --- a/arch-nspawn.in +++ b/arch-nspawn.in @@ -81,14 +81,14 @@ build_mount_args() { for host_mirror in "${host_mirrors[@]}"; do if [[ $host_mirror == *file://* ]]; then host_mirror_path=$(echo "$host_mirror" | sed -r 's#file://(/.*)/\$repo/os/\$arch#\1#g') - mount_args+=("--bind-ro=$host_mirror_path") + mount_args+=("--bind-ro=${host_mirror_path//:/\\:}") fi done - mount_args+=("--bind=${cache_dirs[0]}") + mount_args+=("--bind=${cache_dirs[0]//:/\\:}") for cache_dir in "${cache_dirs[@]:1}"; do - mount_args+=("--bind-ro=$cache_dir") + mount_args+=("--bind-ro=${cache_dir//:/\\:}") done } -- cgit v1.2.3-54-g00ecf