Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

Updates for Brave on macOS should not be quarantined #13817

Closed
bsclifton opened this issue Apr 12, 2018 · 5 comments
Closed

Updates for Brave on macOS should not be quarantined #13817

bsclifton opened this issue Apr 12, 2018 · 5 comments

Comments

@bsclifton
Copy link
Member

bsclifton commented Apr 12, 2018

Test plan

Perform the following steps for:

  • build installed to /Applications/Brave.app
  • custom build installed to a particular folder (ex: ~/Desktop/brave/Brave.app)
  • custom build installed to a path with spaces (ex: ~/Desktop/brave folder/Brave.app)

Steps:

  1. Install browser-laptop 0.22.13 https://github.com/brave/browser-laptop/releases/tag/v0.22.13dev
  2. run xattr <path to Brave.app> and verify it’s not quarantined. If it is, run xattr -d com.apple.quarantine <path to Brave.app>
  3. Launch Brave. Open about:brave to verify version is 0.22.13
  4. Close Brave.
  5. Launch via CLI using BRAVE_ENABLE_PREVIEW_UPDATES=true /Applications/Brave.app/Contents/MacOS/Brave
  6. Use menu to pick Brave > Check for Updates...
  7. Update should be shown - will prompt you to restart - click update to do so
  8. Brave exists and then shows the message box (see image below)
  9. (optional) you can run xattr <path to Brave.app> while the dialog is shown to verify it's quarantined
  10. Click "Open" on the dialog to continue loading Brave
  11. Brave should now load properly - by the time it loads, fix has already been applied for /Applications/Brave.app
  12. You can quit Brave and run the following from the CLI:
    xattr /Applications/Brave.app/
    
    This should NOT return com.apple.quarantine
    If you run this command for a custom path install, you WILL still see the attribute
  13. Re-launch Brave and verify 1Password works as expected
  14. If you had a custom path install, use the xattr command now to ensure com.apple.quarantine is removed

Description

Unintentionally introduced with brave/muon#484

After doing an update on macOS using 0.22.13 (to any version), user is presented with this message box:
image

This is a bad user experience. Because it has been quarantined, this can also affect extensions like 1Password, causing them to not work properly.

Steps to reproduce

  1. Install browser-laptop 0.22.13 https://github.com/brave/browser-laptop/releases/tag/v0.22.13dev
  2. Launch via CLI using BRAVE_ENABLE_PREVIEW_UPDATES=true /Applications/Brave.app/Contents/MacOS/Brave
  3. Use menu to pick Brave > Check for Updates...
  4. Update should be shown - will prompt you to restart - click update to do so
  5. Brave exists and then shows the message box (above)
  6. You can quit Brave and run the following from the CLI:
xattr /Applications/Brave.app/

If the binary is quarantined, it'll return back:
com.apple.quarantine

@bsclifton bsclifton added this to the 0.22.x Release 2 milestone Apr 12, 2018
@bsclifton
Copy link
Member Author

Potential fix here: brave/muon#569

@LaurenWags
Copy link
Member

Custom install paths don't work (ex. /Users/laurenwagner/Brave\ Documents/Laptop/0.22.19 )

@LaurenWags
Copy link
Member

xattr-02

@bsclifton
Copy link
Member Author

Fixed with 8aff60d

The root cause was that the auto-updater would relaunch the executable as something like this:
/private/var/folders/dm/q17j77q14sbgq0tv_xh1ttx40000gn/T/AppTranslocation/0F799E4D-3837-4140-9D0E-2E1AF29F8AF3/d/Brave.app/Contents/MacOS/Brave

When xattr runs, it would get this error (which was masked since CLI isn't open)
xattr: [Errno 30] Read-only file system: '/private/var/folders/dm/q17j77q14sbgq0tv_xh1ttx40000gn/T/AppTranslocation/7C9C45CC-E4BA-4E54-8564-E76379236FF1/d/Brave.app'

@LaurenWags
Copy link
Member

Verified on macOS 10.12.6 x64 using the following build:

  • 0.22.21 d5551e6
  • libchromiumcontent: 65.0.3325.181
  • muon: 5.1.2

Scenarios Tested:

  1. Default path (/Applications/Brave.app) - works as expected
  2. Custom path without a space in the name (ex. /Users/lauren/Brave/Laptop/testnospaces/Brave.app) - see below
  3. Custom path with a space in the name (ex. /Users/lauren/Brave/Laptop/test space/Brave.app) - see below

Custom paths work as expected when launching from the terminal in Step 13. If you launch from the icon, then the quarantine flag is not removed.

Work around: launch from the terminal (once) using /Contents/MacOS/Brave or re-install 0.22.21.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants