Skip to content

Respect PAM when invoking sudo#466

Open
myyra wants to merge 1 commit intoXcodesOrg:mainfrom
myyra:use-standard-sudo-flow
Open

Respect PAM when invoking sudo#466
myyra wants to merge 1 commit intoXcodesOrg:mainfrom
myyra:use-standard-sudo-flow

Conversation

@myyra
Copy link

@myyra myyra commented Mar 9, 2026

The current sudo mechanism bypasses sudo's normal PAM configuration and results in double-prompting with non-default PAM configurations.

xcodes will prompt for macOS User Password: first, and after entering the password, sudo will prompt again for its configured authentication method, like Touch ID when using pam_tid.so.

This change replaces the custom password flow with sudo -v to do the authentication, followed by normal sudo invocations. That lets sudo use the system PAM configuration instead of collecting a password in xcodes before authenticating. This does not change the overall privilege model, and the existing explanatory log line before authentication is also kept intact.

Replace xcodes' custom password prompt and sudo -S piping with a real
sudo -v followed by normal sudo invocations. This lets sudo use the
system PAM stack instead of collecting a password in xcodes before sudo
authenticates again.

Authenticate once up front in the install and xcode-select flows, then
run the privileged commands normally. Update tests, fixtures, and docs
to match the system-managed sudo prompt.
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