-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add support for running framework and CLI as root #2119
Merged
Merged
Conversation
This file contains 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
Several things need to be done still for this to be properly polished including: * Changing the owner/group of the progress tool parent directory to match the $USER correctly in all cases (i.e, not assume the Updater.app is owned by the regular user) * Passing $USER and $HOME to guided pkg installer properly * Not hardcoding GroupName to staff or not passing it at all
The API we use to convert HTML release notes to text is from AppKit, which we should not be calling under the root user. Ideally we would find a better alternative API for handling HTML..
--interactive needs to be passed in this case for sparkle-cli.
This was referenced May 5, 2022
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.
We add support for running the framework and sparkle-cli as root by ensuring we launch the installer in the system domain, and launch the updater progress tool agent in the user domain.
When running as the root user, there is also no need to attempt authorization or show a prompt. We also need to fetch the agent user name and home directory so we can pass that when running guided package installations with custom scripts.
Rather than explicitly specifying what user to "drop down" to for the agent, we infer the user from the current console / GUI login session. Launchd makes inferences here as well for using this user when we submit the launchd agent job.
Misc Checklist:
Only bug fixes to regressions or security fixes are being backported to the 1.x (master) branch now. If you believe your change is significant enough to backport, please also create a separate pull request against the master branch.
Testing
I tested and verified my change by using one or multiple of these methods:
Tested running sparkle-cli as sudo and without on the Test Application, without any authorization prompts.
Tested ssh'ing on my machine (from the same machine) with sudo and tested updating still works.
Tested ssh'ing from a remote machine with sudo and tested updating still works, as long as the the logged in ssh user matches the active GUI user session on the machine (if these do not match, updating will not work).
Tested running sparkle-cli as sudo and without (with interactive) on guided pkg installation.
Tested running sparkle-cli as sudo with interactive based pkg are unsupported.
Tested resuming an update to be installed (without privileges) with sparkle-cli as sudo works.
macOS version tested: 12.3 (21E230)