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