aboutsummaryrefslogtreecommitdiffstats
path: root/package/base-files
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2015-09-23 11:55:18 +0000
committerRafał Miłecki <zajec5@gmail.com>2015-09-23 11:55:18 +0000
commit1898cdc737c0f4e46820c6816f8af9d6578aebf4 (patch)
tree80cc07a7a0fed7d955f86165a0a97721d216dd83 /package/base-files
parentec73b2e3832fcd0957603ad8d2aa6f3a13f09cdb (diff)
downloadupstream-1898cdc737c0f4e46820c6816f8af9d6578aebf4.tar.gz
upstream-1898cdc737c0f4e46820c6816f8af9d6578aebf4.tar.bz2
upstream-1898cdc737c0f4e46820c6816f8af9d6578aebf4.zip
base-files: sysupgrade: quote source image name
get_image() eval a filename without quoting it, resulting in errors with filenames containing characters that need to be escaped. $ sysupgrade -T -f ./cfg\(12\).tar.gz img.bin; echo $? Image check 'platform_check_image' failed. Invalid config file. Please use only .tar.gz files 1 $ mv cfg\(12\).tar.gz cfg_12.tar.gz $ mv img\(1\).bin img.bin sysupgrade -T -f ./cfg_12.tar.gz img.bin; echo $? 0 Enclose the content of $from in double quotes. Signed-off-by: Adrien Schildknecht <adrien+dev@schischi.me> Backport of r46919 git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@47028 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/base-files')
-rw-r--r--package/base-files/files/lib/upgrade/common.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index 189ef69e95..761b4c1795 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -184,14 +184,14 @@ get_image() { # <source> [ <command> ]
*) cmd="cat";;
esac
if [ -z "$conc" ]; then
- local magic="$(eval $cmd $from 2>/dev/null | dd bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')"
+ local magic="$(eval $cmd \"$from\" 2>/dev/null | dd bs=2 count=1 2>/dev/null | hexdump -n 2 -e '1/1 "%02x"')"
case "$magic" in
1f8b) conc="zcat";;
425a) conc="bzcat";;
esac
fi
- eval "$cmd $from 2>/dev/null ${conc:+| $conc}"
+ eval "$cmd \"$from\" 2>/dev/null ${conc:+| $conc}"
}
get_magic_word() {