Skip to content

Support replacing root owned applications for install - #56

Merged
jspahrsummers merged 7 commits into
masterfrom
admin-install
Sep 26, 2013
Merged

jspahrsummers merged 7 commits into
masterfrom
admin-install

Conversation

@keithduncan

Copy link
Copy Markdown
Member

Fixes #54

Tests for this will be tricky, see the commit messages, but it would be worth figuring something out.

@jspahrsummers

Copy link
Copy Markdown
Member

Can't we use SMJobBless for this?

@keithduncan

Copy link
Copy Markdown
Member Author

It would make Squirrel framework less “drag and drop” to include and use but it does let us make the job persistent which could be an advantage, SMJobBless is basically writing the job description to disk in the correct location + SMJobSubmit.

SMJobBless requires the helper tool to be in the application bundle’s Contents/Library/LaunchServices directory so shipit would have to be moved into there at build time rather than living inside Squirrel.framework.

It would also need cooperation between the application and helper tool’s Info.plist, we can craft a requirement string for the helper tool which matches all applications, just make the requirement test true, not sure if that’s a good idea but we can do it, so applications using Squirrel would just need to copy the helper and add an SMPrivilegedExecutables entry to their Info.plist.

Without needing the job persistence yet I’d say we hold off on SMJobBless, what do you think?

@ghost ghost assigned jspahrsummers Sep 25, 2013
Comment thread Squirrel/SQRLShipItLauncher.h Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you add some punctuation/capitalization here so it looks nice in a (hypothetical) documentation generator?

@jspahrsummers

Copy link
Copy Markdown
Member

@keithduncan Based on that, I don't think we should use SMJobBless. Ease of inclusion in the client application is more important.

What's the behavior here if the user rejects privilege escalation? Will they keep getting prompted in the current session or future sessions? I don't really even know what the desirable behavior is.

@keithduncan

Copy link
Copy Markdown
Member Author

@jspahrsummers if they reject an error will bubble up from the authorization API, next time the install is attempted they’ll get prompted again which would be on next quit of the host application.

Should we include some recording of ignored updates in the framework?

💂‍♂️

Keith Duncan added 6 commits September 25, 2013 14:21
This controls whether ShipIt is added to the user’s or system’s launchd domain, and determines whether it’s run as the user or root.
The framework determines whether to use a privileged ShipIt based on whether it can write to the target location, I tested that this can replace root:wheel owned test applications
The tests statically use a nonprivileged helper because Authorization prompts for username/password.

The username/password can be provided to the authorization API but we'd need to know them in advance, perhaps through environment variables. Other than that I’m not sure how to test this.
Comment thread Squirrel/SQRLShipItLauncher.m Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The system adds more to the prompt we provide and it gets quite wordy

screen shot 2013-09-25 at 13 58 38

How about cheating, then, and using a prompt like this (verbatim):

To automatically update itself,

Or, if we don't want to depend on the format staying the same:

An update is ready to install.

I dunno, it definitely sounds duplicative right now.

@jspahrsummers

Copy link
Copy Markdown
Member

Should we include some recording of ignored updates in the framework?

I dunno. I don't want to pester users, but we also want to keep the update in the forefront of their mind. Maybe we could stop after 2 or 3 attempts?

@github/mac Any thoughts on this?

@alanjrogers

Copy link
Copy Markdown

I dunno. I don't want to pester users, but we also want to keep the update in the forefront of their mind. Maybe we could stop after 2 or 3 attempts?

👍 as long as we reset it for subsequent updates.

@keithduncan

Copy link
Copy Markdown
Member Author

I dunno. I don't want to pester users, but we also want to keep the update in the forefront of their mind. Maybe we could stop after 2 or 3 attempts?

👍 on limiting this for automatic updates, but it should also differentiate user initiated updates and always prompt for those, i.e. in GHfM when clicking “Relaunch”

@ghost ghost assigned keithduncan Sep 26, 2013
@jspahrsummers

Copy link
Copy Markdown
Member

I'm still interesting in making the prompt less annoying, but prompting every time is still better than prompting no times, so I'ma merge this.

jspahrsummers added a commit that referenced this pull request Sep 26, 2013
Support replacing root owned applications for install
@jspahrsummers
jspahrsummers merged commit b111237 into master Sep 26, 2013
@jspahrsummers
jspahrsummers deleted the admin-install branch September 26, 2013 16:05
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.

No permissions prompt when running on a non-admin account

3 participants