]> code.ossystems Code Review - openembedded-core.git/commitdiff
toolchain-shar-extract.sh: check the length for target_sdk_dir
authorWenlin Kang <wenlin.kang@windriver.com>
Wed, 23 Mar 2016 08:35:49 +0000 (16:35 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 28 Mar 2016 14:54:51 +0000 (15:54 +0100)
Check the length for target_sdk_dir to ensure the relocation
behaviour in relocate_sdk.py is correct.

Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/files/toolchain-shar-extract.sh

index 12d39c38933c796a7ce7c4ea29832862767ba068..0295bded6e15749ffdd74c6475f3e35e7eedf9e6 100644 (file)
@@ -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