SYSTEMOWNER

This commit is contained in:
Søren Theilgaard
2021-12-01 21:36:30 +01:00
parent 49470cdfdd
commit 886ab1238a
2 changed files with 10 additions and 2 deletions

View File

@@ -392,11 +392,12 @@ installAppWithPath() { # $1: path to app to install in $targetDir
fi
# set ownership to current user
if [ "$currentUser" != "loginwindow" ]; then
if [[ "$currentUser" != "loginwindow" && $SYSTEMOWNER -ne 1 ]]; then
printlog "Changing owner to $currentUser"
chown -R "$currentUser" "$targetDir/$appName"
else
printlog "No user logged in, not changing user"
printlog "No user logged in or SYSTEMOWNER=1, setting owner to root:wheel"
chown -R root:wheel "$targetDir/$appName"
fi
elif [[ ! -z $CLIInstaller ]]; then

View File

@@ -88,6 +88,13 @@ IGNORE_APP_STORE_APPS=no
# Shouldnt give any problems for the user in most cases.
# Known bad example: Slack will loose all settings.
# Owner of copied apps
SYSTEMOWNER=0
# options:
# - 0 Current user will be owner of copied apps, just like if they
# installed it themselves (default).
# - 1 root:wheel will be set on the copied app.
# Useful for shared machines.
# install behavior
INSTALL=""