From c4287c25f700281522ee52755f6829974d6cdc98 Mon Sep 17 00:00:00 2001 From: Jess Sullivan Date: Fri, 5 Jun 2026 15:29:18 -0400 Subject: [PATCH 1/2] TIN-1758 redact launchd readiness output --- scripts/macos-tcfs-rollout-readiness.sh | 21 +++++++------- scripts/test-macos-tcfs-rollout-readiness.sh | 29 +++++++++++++++++--- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/scripts/macos-tcfs-rollout-readiness.sh b/scripts/macos-tcfs-rollout-readiness.sh index 392a5bf7..5b37d8a8 100755 --- a/scripts/macos-tcfs-rollout-readiness.sh +++ b/scripts/macos-tcfs-rollout-readiness.sh @@ -210,8 +210,7 @@ plist_value() { } check_launch_agent() { - local program="" - local status="" + local argv0="" if [[ ! -f "$LAUNCH_AGENT" ]]; then fail "LaunchAgent plist not found: $LAUNCH_AGENT" @@ -222,23 +221,23 @@ check_launch_agent() { note "launch label: $LAUNCH_LABEL" if [[ -x "$PLISTBUDDY_BIN" ]]; then - program="$(plist_value "ProgramArguments:2" "$LAUNCH_AGENT" || true)" - if [[ -n "$program" ]]; then - note "launch agent command: $program" - note "launch agent command inspection: not executed" + argv0="$(plist_value "ProgramArguments:0" "$LAUNCH_AGENT" || true)" + if [[ -n "$argv0" ]]; then + note "launch agent command: configured (argv0: $argv0)" + note "launch agent command inspection: redacted" else - warn "could not read ProgramArguments:2 from LaunchAgent" + warn "could not read ProgramArguments:0 from LaunchAgent" fi else warn "PlistBuddy not executable: $PLISTBUDDY_BIN" fi if command -v "$LAUNCHCTL_BIN" >/dev/null 2>&1; then - status="$("$LAUNCHCTL_BIN" print "gui/$(id -u)/$LAUNCH_LABEL" 2>&1 || true)" - if grep -Fq "Could not find service" <<<"$status"; then - fail "launchd service not found: $LAUNCH_LABEL" - else + if "$LAUNCHCTL_BIN" list 2>/dev/null \ + | awk -v label="$LAUNCH_LABEL" '$3 == label { found = 1 } END { exit found ? 0 : 1 }'; then note "launchd service: present ($LAUNCH_LABEL)" + else + fail "launchd service not found: $LAUNCH_LABEL" fi else warn "launchctl not found" diff --git a/scripts/test-macos-tcfs-rollout-readiness.sh b/scripts/test-macos-tcfs-rollout-readiness.sh index 39a0b653..a3bdd0d3 100755 --- a/scripts/test-macos-tcfs-rollout-readiness.sh +++ b/scripts/test-macos-tcfs-rollout-readiness.sh @@ -19,6 +19,18 @@ assert_contains() { fi } +assert_not_contains() { + local file="$1" + local unexpected="$2" + + if grep -Fq -- "$unexpected" "$file"; then + printf 'expected not to find %s in %s\n' "$unexpected" "$file" >&2 + printf '%s\n' '--- output ---' >&2 + cat "$file" >&2 + exit 1 + fi +} + assert_not_exists() { local path="$1" if [[ -e "$path" ]]; then @@ -125,7 +137,14 @@ fi EOF cat >"$FAKE_BIN/launchctl" <<'EOF' #!/usr/bin/env bash -printf 'service = dev.tinyland.tcfsd\n' +case "${1:-}" in + list) + printf '123\t0\tdev.tinyland.tcfsd\n' + ;; + *) + exit 2 + ;; +esac EOF cat >"$FAKE_BIN/pluginkit" <<'EOF' #!/usr/bin/env bash @@ -138,8 +157,8 @@ EOF cat >"$FAKE_BIN/PlistBuddy" < Date: Fri, 5 Jun 2026 19:38:57 -0400 Subject: [PATCH 2/2] TIN-1758 verify FileProvider registration path --- scripts/macos-tcfs-rollout-readiness.sh | 17 ++++++++++++++--- scripts/test-macos-tcfs-rollout-readiness.sh | 7 +++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/scripts/macos-tcfs-rollout-readiness.sh b/scripts/macos-tcfs-rollout-readiness.sh index 5b37d8a8..af468bf7 100755 --- a/scripts/macos-tcfs-rollout-readiness.sh +++ b/scripts/macos-tcfs-rollout-readiness.sh @@ -22,7 +22,7 @@ Options: (default: ~/Library/LaunchAgents/dev.tinyland.tcfsd.plist) --launch-label