build_image.sh: OPTIND prevent unwanted word-splitting

shift $((OPTIND-1)) can be unsafe.To prevent unwanted
word-splitting all parameter expansions should be
double-quoted. Use the safe form for the command:
shift "$((OPTIND-1))"

Fixes: #109

Signed-off-by: Nitesh Konkar niteshkonkar@in.ibm.com
This commit is contained in:
Nitesh Konkar 2018-07-29 03:02:26 +05:30 committed by Nitesh Konkar
parent 8ed7e397e1
commit eedacc1572

View File

@ -105,7 +105,7 @@ main(){
# Agent version
[ -n "${agent_version}" ] || agent_version="${kata_version}"
shift $(( "$OPTIND" - 1 ))
shift "$(( $OPTIND - 1 ))"
git clone "$osbuilder_url" "${tmp_dir}/osbuilder"
pushd "${tmp_dir}/osbuilder"
git checkout "${kata_osbuilder_version}"