Skip to content

Protect shared config sources when linking home aliases - #2

Open
MGRAFF2006 wants to merge 1 commit into
masterfrom
fix/link-home-source-safety
Open

MGRAFF2006 wants to merge 1 commit into
masterfrom
fix/link-home-source-safety

Conversation

@MGRAFF2006

Copy link
Copy Markdown
Owner

Running link-home.sh through a symlinked checkout can bypass its shared-source guard: a destination .config alias into the checkout replaces tracked configuration with broken self-links. Canonicalize the checkout and home roots, reject destination and backup parents inside the shared repository before replacing links, and retain normal local aliases and idempotent installs.

Test plan:

  • python3 scripts/check-deployment.py: temporary actual-script fixtures cover shared parent/backup aliases, checkout aliases, existing content preservation, local aliases, relative custom homes, dry-run/check, and repeated installation.
  • New regression fails against the committed baseline at the original shared-config fixture.
  • bash -n scripts/link-home.sh, shellcheck scripts/link-home.sh, and git diff --check pass.

No live home installation or system/service changes. The agent-kit installer has its own separate fix in #1.

@MGRAFF2006 MGRAFF2006 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent coordinator review of exact head 9101d4a1227aa5e1e06f9dfd943a84eaad81b77d in a separate detached worktree. Reviewed the complete link-home mutation flow, source validation, all machine link sets, path canonicalization, destination preflight, backup creation, and SSH/agent-kit delegation, plus regression fixture. No substantiated finding remains in this PR scope.

Independently ran python3 scripts/check-deployment.py, shellcheck scripts/link-home.sh, bash -n scripts/link-home.sh, and full PR whitespace check; all passed. The actual-script disposable check covers symlinked checkout, shared config/headless/units/SSH/backup aliases, unchanged originals on refusal, external home/config/backup aliases, relative paths, and repeat idempotence. No real home links, systemd units, credentials, or machine services changed.

Installer-specific shared-parent protection remains the separate PR #1; this review does not imply that unrelated old installer logic is safe before that fix lands. Static parent containment does not claim atomic resistance to a concurrent hostile filesystem swap. Bounded comment review, no merge or approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant