From ad18c4bb624a0c0315d7d681dd98df79a063c4c3 Mon Sep 17 00:00:00 2001 From: jetfir3 Date: Sun, 9 Aug 2026 18:03:45 -0400 Subject: [PATCH] Fix mixed-permission Linux installs --- spotx.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spotx.sh b/spotx.sh index e723a80..7f1b7d1 100644 --- a/spotx.sh +++ b/spotx.sh @@ -494,7 +494,7 @@ check_write_permission() { for path_to_check in "$@"; do [[ -d "${path_to_check}" ]] && writePath="${path_to_check}" || writePath="${path_to_check%/*}" [[ ! -w "${path_to_check}" ]] && stagedInstall='true' - [[ ! -w "${writePath}" ]] && { + [[ ! -w "${writePath}" || ( "${platformType}" == "Linux" && -f "${path_to_check}" && ! -O "${path_to_check}" ) ]] && { stagedInstall='true' protectedInstall='true' ((EUID == 0)) && continue @@ -564,6 +564,7 @@ protected_prepare_file() { local source="${1}" destination="${2}" reference="${3}" tempFile tempFile=$(sudo_run mktemp "${destination}.spotx.XXXXXXXX") || return 1 sudo_run cp -a -- "${reference}" "${tempFile}" && + sudo_run chmod u+w -- "${tempFile}" && sudo_run cp -- "${source}" "${tempFile}" && sudo_run chown --reference="${reference}" "${tempFile}" && sudo_run chmod --reference="${reference}" "${tempFile}" &&