fix: make installer gate portable in root CI
TallyNote release / linux-x64 (push) Failing after 3m5s

This commit is contained in:
Qiufeng
2026-09-03 08:02:48 +08:00
parent 69a4b482ec
commit 77598ecc81
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -88,6 +88,12 @@ bash -c '
chmod 700 "$mode_dir"
[[ "$(stat_mode_bits "$mode_dir")" == 448 ]]
mkdir -p "$owner_parent"
# CI runs this shell suite as root. Make the parent genuinely non-root in
# that environment so the assertion exercises the ownership guard instead
# of accidentally passing because root-owned parents are allowed.
if [[ "${EUID:-$(id -u)}" == 0 ]]; then
chown 65534:65534 "$owner_parent"
fi
if (assert_path_chain "$owner_parent/child") >/dev/null 2>&1; then
echo "expected non-root path parent to fail" >&2
exit 1