Skip to content

Harden Softnet SUID setup#1273

Open
fallintoplace wants to merge 1 commit into
openai:mainfrom
fallintoplace:fix/softnet-suid-setup
Open

Harden Softnet SUID setup#1273
fallintoplace wants to merge 1 commit into
openai:mainfrom
fallintoplace:fix/softnet-suid-setup

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

  • use fixed system paths for sudo, chown, and chmod during Softnet SUID setup
  • avoid sh -c and pass privileged command arguments directly
  • validate the resolved Softnet executable before changing ownership or mode
  • use the resolved Softnet path for the passwordless sudo probe

Validation

  • swift run swiftformat Sources/tart/Network/Softnet.swift
  • swift build
  • DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcrun swift test builds the test bundle and runs part of the suite, then hits an existing LayerizerTests fatal unwrap when the registry runner is unavailable

@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: 81cba367a6

ℹ️ 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 on lines +142 to +144
try runInteractiveSudo(
arguments: [chmodExecutablePath, "u+s", softnetExecutablePath],
failureMessage: "failed to configure SUID bit on Softnet executable with Sudo")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore terminal pgrp before second sudo

When the first sudo helper succeeds, runInteractiveSudo has already moved the terminal foreground process group to that sudo process and never restores Tart's process group before returning. This second call then runs while Tart is a background process group and calls tcsetpgrp again, which can stop/fail on interactive terminals; in that case first-time setup gets stuck after chown and before chmod, leaving the Homebrew softnet binary root-owned but not setuid. Please either run both operations in one sudo process or restore Tart's pgrp before launching the next sudo.

Useful? React with 👍 / 👎.

@fallintoplace fallintoplace force-pushed the fix/softnet-suid-setup branch from 81cba36 to 8142831 Compare June 22, 2026 21:40
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