-
Notifications
You must be signed in to change notification settings - Fork 3
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This was referenced Aug 5, 2025
5e2a549
to
2794fe6
Compare
deansheather
approved these changes
Aug 5, 2025
f3468db
to
d04e73f
Compare
2794fe6
to
f404c56
Compare
There 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
d04e73f
to
0dc424c
Compare
f404c56
to
0d77ec3
Compare
Merge activity
|
0d77ec3
to
e51c8a7
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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. See https://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