Mac installer: add logic for setting BOINC as screensaver under OS 10.6

svn path=/trunk/boinc/; revision=18964
This commit is contained in:
Charlie Fenton 2009-09-01 03:51:03 +00:00
parent 94b8fd4c63
commit b50cc81a93
1 changed files with 14 additions and 4 deletions

View File

@ -659,6 +659,7 @@ OSErr UpdateAllVisibleUsers(long brandID)
char s[256]; char s[256];
group *grp; group *grp;
Boolean saverAlreadySet = true; Boolean saverAlreadySet = true;
Boolean found = false;
FILE *f; FILE *f;
OSStatus err; OSStatus err;
long response; long response;
@ -722,14 +723,23 @@ OSErr UpdateAllVisibleUsers(long brandID)
if (response < 0x1060) { if (response < 0x1060) {
f = popen("defaults -currentHost read com.apple.screensaver moduleName", "r"); f = popen("defaults -currentHost read com.apple.screensaver moduleName", "r");
} else { } else {
f = popen("defaults -currentHost read com.apple.screensaver moduleDict -dict", "r"); sprintf(s, "sudo -u %s defaults -currentHost read com.apple.screensaver moduleDict -dict",
dp->d_name);
f = popen(s, "r");
} }
if (f) { if (f) {
PersistentFGets(s, sizeof(s), f); found = false;
if (!strstr(s, saverName[brandID])) while (PersistentFGets(s, sizeof(s), f)) {
saverAlreadySet = false; if (strstr(s, saverName[brandID])) {
found = true;
break;
}
}
pclose(f); pclose(f);
if (!found) {
saverAlreadySet = false;
}
} }
seteuid(saved_uid); // Set effective uid back to privileged user seteuid(saved_uid); // Set effective uid back to privileged user