Squirrel / Squirrel.Mac

:shipit: Cocoa framework for updating OS X apps :shipit:
MIT License
1.59k stars 128 forks source link

Squirrel tries to escalate privileges even when user owns the parent directory #199

Closed joaomoreno closed 7 years ago

joaomoreno commented 7 years ago

Very similar to #131, all the symptoms are the same... but there's a different twist.

With a VSCode build, in a fresh new macOS 10.12.3:

Why is there an escalation dialog coming up, even when the user owns the folder?

joaomoreno commented 7 years ago

I now see what the difference is: when launching from ~/Desktop or ~/Downloads, htop says the process running is:

/private/var/folders/6t/nm18ywnx13lghb8ccx3js2mc0000gn/T/AppTranslocation/2B87D66E-E1C2-4F24-A64A-4A71F73C4940/d/Visual Studio Code - Insiders.app

Here are the permissions:

➜  ~ ls -la /private/var/folders/6t/nm18ywnx13lghb8ccx3js2mc0000gn/T/AppTranslocation/2B87D66E-E1C2-4F24-A64A-4A71F73C4940/d                               
total 0
dr-xr-xr-x  3 joao  staff    0 Feb  6 16:51 .
dr-xr-xr-x  3 joao  staff    0 Feb  6 16:51 ..
drwxr-xr-x@ 3 joao  staff  102 Nov  9 16:15 Visual Studio Code - Insiders.app

The parent folder is not writable by me! This would make this code try to update with privileges.

joshaber commented 7 years ago

Yup, this is https://github.com/Squirrel/Squirrel.Mac/issues/182. I would have thought https://github.com/Squirrel/Squirrel.Mac/pull/186 would surface a more user-friendly error.

joaomoreno commented 7 years ago

Absolutely, closing as dupe of #182, thanks @joshaber