From: Wenlin Kang Date: Wed, 23 Mar 2016 08:35:49 +0000 (+0800) Subject: toolchain-shar-extract.sh: check the length for target_sdk_dir X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~26369 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2145bd0d188158c2db85b583b4d7f3ad4612593b;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git toolchain-shar-extract.sh: check the length for target_sdk_dir Check the length for target_sdk_dir to ensure the relocation behaviour in relocate_sdk.py is correct. Signed-off-by: Wenlin Kang Signed-off-by: Richard Purdie --- diff --git a/meta/files/toolchain-shar-extract.sh b/meta/files/toolchain-shar-extract.sh index 12d39c38933..0295bded6e1 100644 --- a/meta/files/toolchain-shar-extract.sh +++ b/meta/files/toolchain-shar-extract.sh @@ -110,6 +110,12 @@ else target_sdk_dir=$(readlink -m "$target_sdk_dir") fi +# limit the length for target_sdk_dir, ensure the relocation behaviour in relocate_sdk.py has right result. +if [ ${#target_sdk_dir} -gt 2048 ]; then + echo "Error: The target directory path is too long!!!" + exit 1 +fi + if [ "$SDK_EXTENSIBLE" = "1" ]; then # We're going to be running the build system, additional restrictions apply if echo "$target_sdk_dir" | grep -q '[+\ @$]'; then