- Notifications
You must be signed in to change notification settings - Fork5
fix: always open app as logged-in user in postinstall script#216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
ethanndickson commentedAug 5, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
5e2a549
to2794fe6
Comparef3468db
tod04e73f
Compare2794fe6
tof404c56
CompareThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR fixes an issue where the Coder Desktop app would launch as root when installed via MDM, causing keychain access problems. The fix ensures the app always launches under the logged-in user's context in the postinstall script.
Key changes:
- Replaces simple
open -a
command with user-specific launch command - Adds logic to detect the current console user and launch the app under their context
- Includes explanatory comments about the MDM deployment scenario
Uh oh!
There was an error while loading.Please reload this page.
d04e73f
to0dc424c
Comparef404c56
to0d77ec3
Compareethanndickson commentedAug 6, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Merge activity
|
0d77ec3
toe51c8a7
Compare4ba6ca3
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
This PR prevents issues like:
which occur when the app is launched as root. This can happen when the installer scripts are run as root, which is the case when deploying Coder Desktop over MDM. (As a convenience, we re-open the app if it was open before the installer was ran.)
Of note is that on macOS, it is not sufficient to just run open with
sudo -u
, as that does not use the execution context of the user. Seehttps://developer.apple.com/forums/thread/78332Reports of the bug in other programs:
(with an incorrect solution)https://community.zoom.com/t5/Zoom-Meetings/A-keychain-cannot-be-found-to-stoer-quot-Zoom-quot/m-p/51059
https://displaylink.org/forum/showthread.php?p=97176