From 80f50ca20b9c6afd5e9b394ab50a00d938969ea3 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 22 Apr 2020 07:45:58 +0300 Subject: [PATCH] kiss: Abort install if file missing in manifest --- kiss | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kiss b/kiss index 3f32854..6b3e8c0 100755 --- a/kiss +++ b/kiss @@ -969,6 +969,12 @@ pkg_install() { [ -f "$tar_dir/$pkg_name/$pkg_db/$pkg_name/manifest" ] || die "'${tar_file##*/}' is not a valid KISS package" + # Ensure that the tarball's manifest is correct by checking that + # each file and directory inside of it actually exists. + while read -r line; do [ -e "$tar_dir/$pkg_name/$line" ] || + die "File $line missing from tarball but mentioned in manifest" + done < "$tar_dir/$pkg_name/$pkg_db/$pkg_name/manifest" + log "$pkg_name" "Checking that all dependencies are installed"; { [ -f "$tar_dir/$pkg_name/$pkg_db/$pkg_name/depends" ] && [ -z "$KISS_FORCE" ] &&