Skip to content

fix(implode): prevent deletion of home and filesystem roots - #3228

Draft
jong-kyung wants to merge 3 commits into
voidzero-dev:mainfrom
jong-kyung:fix/implode-protected-roots
Draft

jong-kyung wants to merge 3 commits into
voidzero-dev:mainfrom
jong-kyung:fix/implode-protected-roots

Conversation

@jong-kyung

Copy link
Copy Markdown
Collaborator

Summary

With VP_HOME=$HOME, vp implode --yes could recursively delete the user's home directory.

Reject deletion targets that are the user home, an ancestor of the home, or a filesystem root. Check canonical paths to
catch symlink aliases, and validate all deletion targets before modifying profiles, PATH, or files, including with --yes.

Reject protected deletion targets before modifying shell profiles, PATH,
or managed files, including with --yes. Check canonical paths to catch
symlink aliases and validate all roots before starting split-layout cleanup.

Add regression coverage for protected roots, normal installations,
symlink aliases, and preservation of files when validation fails.
@jong-kyung jong-kyung self-assigned this Oct 25, 2026
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-25T05:36:43.004358Z e64845e Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jong-kyung
jong-kyung marked this pull request as ready for review October 25, 2026 03:32
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@jong-kyung
jong-kyung requested a review from fengmk2 October 25, 2026 03:33
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

An unknown error occurred
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fengmk2 fengmk2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The home/root protection works in the targeted Linux tests, but I would like us to complete the directory ownership protection in this PR before merging. A mistaken VP_HOME override can still delete unrelated data. Please address the inline comment and add regression coverage for unowned directories.

Comment thread crates/vp_global_cli/src/commands/implode.rs
@jong-kyung
jong-kyung marked this pull request as draft October 25, 2026 05:26
Require ownership markers for every existing data, cache, config, and state root before changing files, shell profiles, or PATH. Validate nested roots independently and collapse them only when building the final recursive deletion targets. Preserve the home and filesystem root safeguards.

Check that new installation roots are empty before recording ownership. Keep nonempty legacy roots unmarked so existing installations remain usable without granting permission to delete unrelated contents.

Cover ownership checks, nested and split roots, fresh setup, and legacy setup with isolated unit tests and CLI snapshots.
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

Recognize an existing current entry without following its target, matching
installation directory resolution even when the active binary is missing.
Keep repaired legacy roots unmarked so implode still refuses their removal.

Extend the existing installer CI cases to verify ownership is not claimed
when reusing a legacy root or repairing a dangling junction.

This branch has not been deployed

No deployments
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.

2 participants