fix(installer): close detector false-pass gaps
This commit is contained in:
@@ -182,14 +182,19 @@ fi
|
||||
printf '[fixture] installer_exit=%d done_claims=%s\n' \
|
||||
"$install_status" "$(grep -cF 'Done.' "$install_log" || true)"
|
||||
|
||||
# P0 Resolve context
|
||||
shell="$(getent passwd "$(id -u)" | cut -d: -f7)"
|
||||
if [[ "$(id -u)" -ne 0 && "$home" == "/home/mosaic" && "$shell" == "/bin/bash" ]] \
|
||||
# P0 Resolve context. Keep this final fixture row as discriminating as the
|
||||
# installer's own P0 row: the expected-RED comparator binds this exact reason.
|
||||
passwd_row="$(getent passwd "$(id -u)")"
|
||||
target_user="$(printf '%s' "$passwd_row" | cut -d: -f1)"
|
||||
passwd_home="$(printf '%s' "$passwd_row" | cut -d: -f6)"
|
||||
shell="$(printf '%s' "$passwd_row" | cut -d: -f7)"
|
||||
if [[ "$(id -u)" -eq 1001 && "$target_user" == "mosaic" \
|
||||
&& "$home" == "/home/mosaic" && "$home" == "$passwd_home" && "$shell" == "/bin/bash" ]] \
|
||||
&& ldd --version 2>&1 | grep -i 'glibc\|gnu libc' >/dev/null \
|
||||
&& [[ "$(node -p 'Number(process.versions.node.split(".")[0])')" -ge 20 ]]; then
|
||||
phase_pass P0 "target=mosaic uid=$(id -u) HOME=$home shell=$shell libc=glibc node=$(node --version)"
|
||||
phase_pass P0 "target=$target_user uid=$(id -u) HOME=$home passwd_HOME=$passwd_home shell=$shell privilege=user arch=$(uname -m) libc=glibc node=$(node --version) npm=$(npm --version)"
|
||||
else
|
||||
phase_fail P0 "context unresolved or unsupported (uid=$(id -u) HOME=$home shell=${shell:-unknown})"
|
||||
phase_fail P0 "context unresolved or unsupported (target=${target_user:-unknown} uid=$(id -u) HOME=$home passwd_HOME=${passwd_home:-unknown} shell=${shell:-unknown} privilege=user)"
|
||||
fi
|
||||
|
||||
# P1 Preflight
|
||||
|
||||
Reference in New Issue
Block a user