From e16af78828b0f9cf72972d455a6a9d36d3366065 Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 28 Feb 2025 04:07:57 +0100 Subject: [PATCH] feat: Check path to custom .iso (#1069) --- src/install.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/install.sh b/src/install.sh index 7f10eec06..c1ed86ace 100644 --- a/src/install.sh +++ b/src/install.sh @@ -200,10 +200,16 @@ abortInstall() { detectCustom() { local file base + local fname="custom.iso" + CUSTOM="" - file=$(find / -maxdepth 1 -type f -iname custom.iso | head -n 1) - [ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname custom.iso | head -n 1) + if [ -d "/$fname" ]; then + error "The file /$fname has an invalid path!" && return 1 + fi + + file=$(find / -maxdepth 1 -type f -iname "$fname" | head -n 1) + [ ! -s "$file" ] && file=$(find "$STORAGE" -maxdepth 1 -type f -iname "$fname" | head -n 1) if [ ! -s "$file" ] && [[ "${VERSION,,}" != "http"* ]]; then base=$(basename "$VERSION") @@ -487,6 +493,10 @@ setXML() { local file="/custom.xml" + if [ -d "$file" ]; then + warn "The file $file has an invalid path!" + fi + [ ! -f "$file" ] || [ ! -s "$file" ] && file="$STORAGE/custom.xml" [ ! -f "$file" ] || [ ! -s "$file" ] && file="/run/assets/custom.xml" [ ! -f "$file" ] || [ ! -s "$file" ] && file="$1"