Skip to content

Fix installing updates which need escalated privileges - #207

Merged
joshaber merged 9 commits into
masterfrom
escalators-are-dangerous
Jul 20, 2017
Merged

joshaber merged 9 commits into
masterfrom
escalators-are-dangerous

Conversation

@joshaber

@joshaber joshaber commented Jul 17, 2017 •

Copy link
Copy Markdown
Contributor

⚠️ Dependent on #206 ⚠️

Fixes #157
Fixes #131

There were two problems:

  1. We checked if we could write to the app bundle itself and escalated, but we didn't check if we could write to its parent directory to replace the bundle.
  2. If we escalated, our user-scoped paths wouldn't be valid since ShipIt would run as root.

I still need to find a way to test this, even if just by hand, to verify the above issues really are fixed.

@joshaber joshaber changed the title [WIP] Fix installing updates Fix installing updates Jul 18, 2017
@joshaber

joshaber commented Jul 18, 2017 •

Copy link
Copy Markdown
Contributor Author

I've manually tested the following scenarios:

  1. User-owned app bundle and parent directory. Succeeds 👍
  2. Root-owned app bundle and user-owned parent directory. Escalates and succeeds 👍
  3. Root-owner parent directory. Escalates and succeeds 👍

@joshaber joshaber changed the title Fix installing updates Fix installing updates which need escalated privileges Jul 18, 2017
@joshaber
joshaber changed the base branch from update-xcode to master July 18, 2017 17:48
@joshaber
joshaber merged commit 203315f into master Jul 20, 2017
@joshaber
joshaber deleted the escalators-are-dangerous branch July 20, 2017 13:46
@hhff

hhff commented Jul 29, 2017

Copy link
Copy Markdown

Hi @joshaber - a big big thankyou for tackling this! Really great stuff 👍

@devtobo

devtobo commented Jul 31, 2017

Copy link
Copy Markdown

Is it fixed in Electron (not sure if they or I need to do something to have this fix for my users)?

@joshaber

Copy link
Copy Markdown
Contributor Author

No, Electron hasn't yet released an update which includes this fix.

@Roverclover

Copy link
Copy Markdown

Y

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.

Non-admin that owns an app in /Applications can’t update it Failure to install updates that require administrator privileges

4 participants