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

Commit

Permalink
Merge pull request #13132 from brave/issue/pkg-app-permission-admin
Browse files Browse the repository at this point in the history
Update pkg-installed app permissions to $USER:admin
  • Loading branch information
bsclifton authored Feb 14, 2018
2 parents 50cad6c + 6b4ca00 commit 6fd0946
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions build/pkg-scripts/postinstall
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ echo "Installer path is: $installerPath"
echo "Username is: $userName"
echo "Installation app path is: $installationAppPath"

# Fix the permissions on installed .app so that updater has permissions to write new version
# by default pkg with install the .app with root:wheel owner and 'drwxr-xr-x' permission.
# Fix the permissions on installed .app so that updater has permissions to write new contents.
# By default pkg with install the .app with root:wheel owner and 'drwxr-xr-x' permission.
# Since the app is run by the user, and the updater built-in to electron does not successfully
# escalate to root permissions, updating will fail.
# We'll allow all standard users of the machine permissions to run and update the app.
# We'll allow all admin users of the machine permissions to update the app, as well as the installing-user
# (who may not be an admin).
sudo chmod -R 775 "$installationAppPath"
sudo chgrp -R staff "$installationAppPath"
sudo chown -R $USER "$installationAppPath"
sudo chgrp -R admin "$installationAppPath"

# Detect if installer contained a referral promotion code within the filename
if [[ $installerPath =~ $installerPathPromoCodeRegex ]]; then
Expand Down

0 comments on commit 6fd0946

Please sign in to comment.