2006-07-26 11:40:38 +00:00
|
|
|
#! /bin/sh
|
|
|
|
|
|
|
|
# Berkeley Open Infrastructure for Network Computing
|
|
|
|
# http://boinc.berkeley.edu
|
|
|
|
# Copyright (C) 2006 University of California
|
|
|
|
#
|
|
|
|
# This is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation;
|
|
|
|
# either version 2.1 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This software is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
# See the GNU Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# To view the GNU Lesser General Public License visit
|
|
|
|
# http://www.gnu.org/copyleft/lesser.html
|
|
|
|
# or write to the Free Software Foundation, Inc.,
|
|
|
|
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
2006-07-27 08:55:59 +00:00
|
|
|
# Mac_SA_Insecure.sh user group
|
2006-07-26 11:40:38 +00:00
|
|
|
#
|
|
|
|
# Undo making a Macintosh BOINC installation secure.
|
|
|
|
# - Set file/dir ownership to the specified user and group
|
|
|
|
# - Remove BOINC groups and users
|
|
|
|
#
|
2006-07-27 08:55:59 +00:00
|
|
|
# Execute this as root in the BOINC directory:
|
|
|
|
# cd {path_to_boinc_directory}
|
|
|
|
# sudo sh {path}/Mac_SA_Insecure.sh user group
|
|
|
|
#
|
2006-09-22 02:54:27 +00:00
|
|
|
# After running this script, the boinc client must be run with
|
|
|
|
# the --insecure option.
|
|
|
|
# NOTE: running BOINC with security disabled is not recommended.
|
|
|
|
#
|
|
|
|
# Last updated 9/21/06
|
2006-07-26 11:40:38 +00:00
|
|
|
|
|
|
|
function remove_boinc_users() {
|
2006-09-22 02:54:27 +00:00
|
|
|
name=$(dscl . search /users RecordName boinc_master | cut -f1 -)
|
|
|
|
if [ "$name" = "boinc_master" ] ; then
|
|
|
|
sudo dscl . -delete /users/boinc_master
|
|
|
|
fi
|
|
|
|
|
|
|
|
name=$(dscl . search /groups RecordName boinc_master | cut -f1 -)
|
|
|
|
if [ "$name" = "boinc_master" ] ; then
|
|
|
|
sudo dscl . -delete /groups/boinc_master
|
|
|
|
fi
|
|
|
|
|
|
|
|
name=$(dscl . search /users RecordName boinc_project | cut -f1 -)
|
|
|
|
if [ "$name" = "boinc_project" ] ; then
|
|
|
|
sudo dscl . -delete /users/boinc_project
|
|
|
|
fi
|
2006-07-26 11:40:38 +00:00
|
|
|
|
2006-09-22 02:54:27 +00:00
|
|
|
name=$(dscl . search /groups RecordName boinc_project | cut -f1 -)
|
|
|
|
if [ "$name" = "boinc_project" ] ; then
|
|
|
|
sudo dscl . -delete /groups/boinc_project
|
|
|
|
fi
|
2006-07-26 11:40:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function check_login() {
|
|
|
|
if [ `whoami` != 'root' ]
|
|
|
|
then
|
|
|
|
echo 'This script must be run as root'
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
check_login
|
|
|
|
|
|
|
|
if [ $# -eq 2 ]
|
|
|
|
then
|
|
|
|
user=$1
|
|
|
|
group=$2
|
|
|
|
else
|
|
|
|
echo "usage: $0 user group"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2006-07-26 13:39:59 +00:00
|
|
|
echo "Changing directory $(pwd) file ownership to user $user and group $group - OK? (y/n)"
|
2006-07-26 11:40:38 +00:00
|
|
|
read line
|
|
|
|
if [ "$line" != "y" ]
|
|
|
|
then
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2006-09-22 02:54:27 +00:00
|
|
|
if [ ! -f "boinc" ]
|
2006-07-26 13:39:59 +00:00
|
|
|
then
|
|
|
|
echo "Can't find boinc Client in directory $(pwd); exiting"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2006-07-26 11:40:38 +00:00
|
|
|
chown -R ${user}:${group} .
|
|
|
|
chmod -R u+rw-s,g+r-w-s,o+r-w .
|
|
|
|
chmod 600 gui_rpc_auth.cfg
|
2006-08-01 12:36:19 +00:00
|
|
|
|
2006-09-25 22:32:09 +00:00
|
|
|
if [ -f switcher/AppStats ] ; then
|
|
|
|
# AppStats application must run setuid root (used in BOINC 5.7 and later)
|
2006-09-25 10:49:39 +00:00
|
|
|
chown root:${group} switcher/AppStats
|
|
|
|
chmod 4550 switcher/AppStats
|
2006-09-25 22:32:09 +00:00
|
|
|
fi
|
2006-09-25 10:49:39 +00:00
|
|
|
|
2006-08-01 12:36:19 +00:00
|
|
|
if [ -x /Applications/BOINCManager.app/Contents/MacOS/BOINCManager ] ; then
|
|
|
|
chown ${user}:${group} /Applications/BOINCManager.app/Contents/MacOS/BOINCManager
|
|
|
|
chmod -R u+r-w+s,g+r-ws,o+r-ws /Applications/BOINCManager.app/Contents/MacOS/BOINCManager
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -x /Applications/BOINCManager.app/Contents/Resources/boinc ] ; then
|
|
|
|
chown ${user}:${group} /Applications/BOINCManager.app/Contents/Resources/boinc
|
|
|
|
chmod -R u+r-ws,g+r-ws,o+r-ws /Applications/BOINCManager.app/Contents/Resources/boinc
|
|
|
|
fi
|
|
|
|
|
2006-07-26 11:40:38 +00:00
|
|
|
remove_boinc_users
|