From 2c0486d846c21860872c6fcf76b1729999aa77ff Mon Sep 17 00:00:00 2001 From: Quirin Gylstorff Date: Fri, 5 Nov 2021 16:09:24 +0100 Subject: [PATCH] kas-container: Add check for KAS_REPO_REF_DIR Check if KAS_REPO_REF_DIR exists to avoid an error during the execution of readlink. Signed-off-by: Quirin Gylstorff Signed-off-by: Jan Kiszka --- kas-container | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/kas-container b/kas-container index a73a459..f15ea2b 100755 --- a/kas-container +++ b/kas-container @@ -399,6 +399,10 @@ if [ -n "${SSTATE_DIR}" ]; then fi if [ -n "${KAS_REPO_REF_DIR}" ]; then + if [ ! -d "${KAS_REPO_REF_DIR}" ]; then + echo "Passed KAS_REPO_REF_DIR '${KAS_REPO_REF_DIR}' is not a directory" + exit 1 + fi set -- "$@" \ -v "$(readlink -f "${KAS_REPO_REF_DIR}")":/repo-ref:ro \ -e KAS_REPO_REF_DIR=/repo-ref