mirror of https://github.com/BOINC/boinc.git
Mac installer: add logic for setting BOINC as screensaver under OS 10.6
svn path=/trunk/boinc/; revision=18964
This commit is contained in:
parent
94b8fd4c63
commit
b50cc81a93
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue