Skip to content

Install macOS CLI binary into Cargo bin#3

Closed
logic10492 wants to merge 1 commit into
shadow3aaa:mainfrom
logic10492:feature/macos-client
Closed

Install macOS CLI binary into Cargo bin#3
logic10492 wants to merge 1 commit into
shadow3aaa:mainfrom
logic10492:feature/macos-client

Conversation

@logic10492

Copy link
Copy Markdown
Collaborator
  • Install the CLI binary into the target user’s ~/.cargo/bin/daat-locus from the pkg postinstall script instead of placing a wrapper in /usr/local/bin.

Verification

  • cargo fmt
  • cargo test -p xtask
  • cargo check -p xtask
  • cargo run -p xtask -- package macos --keep-work-dir
  • sh -n target/aarch64-apple-darwin/release/macos-work/pkg-scripts/postinstall
  • pkgutil --expand target/aarch64-apple-darwin/release/macos/daat-locus-0.2.0-aarch64-apple-darwin.pkg ...

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cbe5a07598

ℹ️ 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".

Comment thread xtask/src/main.rs
Comment on lines +734 to +736
/bin/mkdir -p "$cargo_bin_dir"
/usr/bin/install -m 755 "$app_binary" "$destination"
/usr/sbin/chown "$target_user:$target_group" "$cargo_home_dir" "$cargo_bin_dir" "$destination"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reject symlinked Cargo directories before copying as root

In the pkg postinstall context this runs as root, but cargo_home_dir is under the target user's control. If that user has made ~/.cargo a symlink to a protected prefix such as /usr/local before installation, /bin/mkdir -p traverses it, /usr/bin/install copies through it, and this chown can hand ownership of the resulting bin directory or CLI file outside the user's home to that user. Please resolve/lstat the Cargo paths and require real directories under the user's home, or otherwise create/copy without following user-controlled symlinks.

Useful? React with 👍 / 👎.

@shadow3aaa

Copy link
Copy Markdown
Owner

Closing this because we shouldn’t be responsible for coordinating multiple package managers.

@shadow3aaa shadow3aaa closed this Jun 26, 2026
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