2006-07-18 20:39:05 +00:00
|
|
|
#! /bin/sh
|
2006-07-26 11:40:38 +00:00
|
|
|
|
|
|
|
# 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-18 20:39:05 +00:00
|
|
|
# insecure.sh user group
|
|
|
|
#
|
|
|
|
# Undo making a BOINC installation secure.
|
|
|
|
# - Set file/dir ownership to the specified user and group
|
|
|
|
# - Remove BOINC groups and users
|
|
|
|
#
|
|
|
|
# Execute this as root in the BOINC directory
|
|
|
|
|
2006-09-01 21:48:48 +00:00
|
|
|
remove_boinc_users() {
|
2006-07-18 20:39:05 +00:00
|
|
|
userdel boinc_master
|
|
|
|
userdel boinc_projects
|
|
|
|
groupdel boinc_master
|
|
|
|
groupdel boinc_projects
|
|
|
|
}
|
|
|
|
|
2006-09-01 21:48:48 +00:00
|
|
|
check_login() {
|
2006-07-18 20:39:05 +00:00
|
|
|
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-08-22 21:52:44 +00:00
|
|
|
# If the user forgets to cd to the boinc data directory,
|
|
|
|
# this script can do serious damage
|
2006-07-26 13:39:59 +00:00
|
|
|
# so show the directory we are about to modify
|
2006-08-22 21:52:44 +00:00
|
|
|
echo "Changing directory $(pwd) ownership to user $user and group $group - OK? (y/n)"
|
2006-07-18 20:39:05 +00:00
|
|
|
read line
|
|
|
|
if [ "$line" != "y" ]
|
|
|
|
then
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2006-08-22 21:52:44 +00:00
|
|
|
# if the boinc client is not here, assume it is the wrong directory
|
2006-07-26 13:39:59 +00:00
|
|
|
if [ ! -f "boinc_client" ]
|
|
|
|
then
|
|
|
|
echo "Can't find boinc_client in directory $(pwd); exiting"
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2006-07-18 20:39:05 +00:00
|
|
|
chown -R ${user}:${group} .
|
2006-07-25 23:52:00 +00:00
|
|
|
chmod -R u+rw-s,g+r-w-s,o+r-w .
|
2006-07-25 17:39:54 +00:00
|
|
|
chmod 600 gui_rpc_auth.cfg
|
2006-07-18 20:39:05 +00:00
|
|
|
remove_boinc_users
|