Skip to content
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

Brave's PKG installer is sensitive to changes in its file name #39567

Open
1 of 6 tasks
mherrmann opened this issue Jul 4, 2024 · 0 comments
Open
1 of 6 tasks

Brave's PKG installer is sensitive to changes in its file name #39567

mherrmann opened this issue Jul 4, 2024 · 0 comments

Comments

@mherrmann
Copy link

mherrmann commented Jul 4, 2024

Description

Depending on its file name, Brave's PKG installer does or does not correctly set the owner and permissions of the installation directory.

Steps to reproduce

  1. Uninstall Brave.
  2. Delete the file /var/log/install.log via the Terminal: sudo rm /var/log/install.log.
  3. Download Brave's PKG installer from the GitHub releases page.
  4. Install Brave with the installer.

Actual result

The output of the command ls -alh /Applications/Brave\ Browser.app in the Terminal is:

total 0
drwxr-xr-x   3 root  wheel    96B Jul  4 10:12 .
drwxrwxr-x   8 root  admin   256B Jul  4 10:12 ..
drwxr-xr-x  11 root  wheel   352B Jun 25 13:02 Contents

Furthermore, the command grep postinstall /var/log/install.log in the Terminal shows an error:

...
2024-07-04 10:12:34+02 Michaels-iMac-Pro package_script_service[666]: ./postinstall: chmod: /Applications/Brave Browser universal.app: No such file or directory
2024-07-04 10:12:34+02 Michaels-iMac-Pro package_script_service[666]: ./postinstall: chown: /Applications/Brave Browser universal.app: No such file or directory
2024-07-04 10:12:34+02 Michaels-iMac-Pro package_script_service[666]: ./postinstall: chgrp: /Applications/Brave Browser universal.app: No such file or directory

The above mean that Brave was installed into /Applications/Brave Browser.app with ownership root:wheel because the postinstall script could not change the ownership of the files.

Expected result

ls -alh /Applications/Brave\ Browser.app should give:

total 0
drwxrwxr-x   3 michael  admin    96B Jul  4 10:23 .
drwxrwxr-x   8 root     admin   256B Jul  4 10:23 ..
drwxrwxr-x  11 michael  admin   352B Jun 25 13:02 Contents

In words, it should say that the application directory is owned by the installing user and the admin group.

Similarly, grep postinstall /var/log/install.log should not indicate any errors.

This can be achieved by renaming Brave-Browser-universal.pkg to Brave-Browser-BRV001.pkg.

Reproduces how often

Easily reproduced

Brave version (brave://version info)

Brave 1.67.123 Chromium 126.0.6478.126
macOS 13.6.7

Channel information

  • release (stable)
  • beta
  • nightly

Reproducibility

  • with Brave Shields disabled
  • with Brave Rewards disabled
  • in the latest version of Chrome

Miscellaneous information

The bug is caused by the promo code extraction logic in our postinstall script.

This bug is one (if not the only) cause of #9562. When /Applications/Brave Browser.app is owned by root, then installing an update via brave://settings/help and clicking on the ensuing Relaunch button prompts for elevation:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants