mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-04-27 11:31:05 +00:00
kata-deploy: add INSTALLATION_PREFIX validation
INSTALLATION_PREFIX must begin with a "/" because it is being concatenated with /host. If there is no /, displays a message and makes an error. Fixes: #11096 Signed-off-by: Shunsuke Kimura <pbrehpuum@gmail.com>
This commit is contained in:
parent
a49b6f8634
commit
a05f5f1827
@ -66,6 +66,9 @@ INSTALLATION_PREFIX="${INSTALLATION_PREFIX:-}"
|
||||
default_dest_dir="/opt/kata"
|
||||
dest_dir="${default_dest_dir}"
|
||||
if [ -n "${INSTALLATION_PREFIX}" ]; then
|
||||
if [[ "${INSTALLATION_PREFIX:0:1}" != "/" ]]; then
|
||||
die 'INSTALLATION_PREFIX must begin with a "/"(ex. /hoge/fuga)'
|
||||
fi
|
||||
# There's no `/` in between ${INSTALLATION_PREFIX} and ${default_dest_dir}
|
||||
# as, otherwise, we'd have it doubled there, as: `/foo/bar//opt/kata`
|
||||
dest_dir="${INSTALLATION_PREFIX}${default_dest_dir}"
|
||||
|
Loading…
Reference in New Issue
Block a user