Mac Uninstaller: change owner and group of BOINC Data to those of the user running the uninstaller

svn path=/trunk/boinc/; revision=19650
This commit is contained in:
Charlie Fenton 2009-11-19 10:41:47 +00:00
parent 1ed1ed95f2
commit cc53e1401f
2 changed files with 17 additions and 3 deletions

View File

@ -9367,6 +9367,10 @@ Charlie 18 Nov 2009
Charlie 19 Nov 2009
- Mac MGR: fix bug - don't show exit confirmation dialog if shutting
down or restarting system.
- Mac Uninstaller: change owner and group of BOINC Data to those of
the user running the uninstaller.
clientgui/
BOINCGUIApp.cpp
mac_installer/
uninstall.cpp

View File

@ -130,8 +130,10 @@ static OSStatus DoUninstall(void) {
pid_t coreClientPID = 0;
char myRmCommand[MAXPATHLEN+10], plistRmCommand[MAXPATHLEN+10], *p;
char notBoot[] = "/Volumes/";
char cmd[1024];
FSRef theFSRef;
int pathOffset, i;
passwd *pw;
OSStatus err = noErr;
#if TESTING
@ -211,10 +213,17 @@ static OSStatus DoUninstall(void) {
system ("rm -rf /Library/Receipts/Progress\\ Thru\\ Processors.pkg");
system ("rm -rf /Library/Receipts/BOINC.pkg");
// Phase 5: Set BOINC Data owner and group to logged in user
// We don't customize BOINC Data directory name for branding
// system ("rm -rf \"/Library/Application Support/BOINC Data\"");
p = getlogin();
pw = getpwnam(p);
sprintf(cmd, "chown -R %d:%d \"/Library/Application Support/BOINC Data\"", pw->pw_uid, pw->pw_gid);
system (cmd);
system("chmod -R u+rw-s,g+r-w-s,o+r-w \"/Library/Application Support/BOINC Data\"");
system("chmod 600 \"/Library/Application Support/BOINC Data/gui_rpc_auth.cfg\"");
// Phase 5: step through all users and do user-specific cleanup
// Phase 6: step through all users and do user-specific cleanup
CleanupAllVisibleUsers();
system ("dscl . -delete /users/boinc_master");
@ -222,6 +231,7 @@ static OSStatus DoUninstall(void) {
system ("dscl . -delete /users/boinc_project");
system ("dscl . -delete /groups/boinc_project");
return 0;
}