From 40fa2b20964acc491e909743165273da4343f105 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 5 Jun 2023 14:58:08 +0100 Subject: [PATCH] copy-firmware: quote deskdir and dirname Properly quote, otherwise we'll get word splitting. In other words: Files might end up installed to /some/foo/, where /some path/foo bar/ is expected. v2: - rebase/split && also quote the $() output Signed-off-by: Emil Velikov Signed-off-by: Josh Boyer --- copy-firmware.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/copy-firmware.sh b/copy-firmware.sh index bbacb925..e8098271 100755 --- a/copy-firmware.sh +++ b/copy-firmware.sh @@ -34,16 +34,16 @@ done grep '^File:' WHENCE | sed -e's/^File: *//g' -e's/"//g' | while read f; do test -f "$f" || continue $verbose "copying file $f" - install -d $destdir/$(dirname "$f") - cp -d "$f" $destdir/"$f" + install -d "$destdir/$(dirname "$f")" + cp -d "$f" "$destdir/$f" done grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; do if test -L "$f"; then test -f "$destdir/$f" && continue $verbose "copying link $f" - install -d $destdir/$(dirname "$f") - cp -d "$f" $destdir/"$f" + install -d "$destdir/$(dirname "$f")" + cp -d "$f" "$destdir/$f" if test "x$d" != "x"; then target=`readlink "$f"` @@ -63,7 +63,7 @@ grep -E '^Link:' WHENCE | sed -e's/^Link: *//g' -e's/-> //g' | while read f d; d fi else $verbose "creating link $f -> $d" - install -d $destdir/$(dirname "$f") + install -d "$destdir/$(dirname "$f")" ln -sf "$d" "$destdir/$f" fi done