From 5fe65e9fc264cd99449c260fa190f2507cfc13dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Mon, 12 Aug 2024 13:54:24 +0200 Subject: [PATCH] kata-manager: Only check files when tarball is not passed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Only do the checking in case the tarball was not explicitly passed by the user. We have no control of what's passed and we cannot expect that all the files are going to be under /opt. Fixes: #10147 Signed-off-by: Fabiano FidĂȘncio --- utils/kata-manager.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/utils/kata-manager.sh b/utils/kata-manager.sh index 23f3e36d91..3241eec4cf 100755 --- a/utils/kata-manager.sh +++ b/utils/kata-manager.sh @@ -803,20 +803,23 @@ install_kata() local from_dir from_dir=$(printf "%s/bin" "$kata_install_dir") - info "Checking file '$file'" - - # Since we're unpacking to the root directory, perform a sanity check - # on the archive first. - local unexpected - unexpected=$(tar -tf "${file}" |\ - grep -Ev "^(\./$|\./opt/$|\.${kata_install_dir}/)" || true) - - [ -n "$unexpected" ] && die "File '$file' contains unexpected paths: '$unexpected'" - if [ -n "$kata_tarball" ] then info "Installing $project release from $file" else + # Only do the checking in case the tarball was not explicitly passed + # by the user. We have no control of what's passed and we cannot + # expect that all the files are going to be under /opt. + info "Checking file '$file'" + + # Since we're unpacking to the root directory, perform a sanity check + # on the archive first. + local unexpected + unexpected=$(tar -tf "${file}" |\ + grep -Ev "^(\./$|\./opt/$|\.${kata_install_dir}/)" || true) + + [ -n "$unexpected" ] && die "File '$file' contains unexpected paths: '$unexpected'" + info "Installing $project release $version from $file" fi