From 03f59980be11d70bc9fc8d200b925788118126e2 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Wed, 7 Jun 2006 10:14:05 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=10269 --- clientgui/mac/SetupSecurity.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/clientgui/mac/SetupSecurity.cpp b/clientgui/mac/SetupSecurity.cpp index e7dde14c80..57f68df8ed 100644 --- a/clientgui/mac/SetupSecurity.cpp +++ b/clientgui/mac/SetupSecurity.cpp @@ -65,7 +65,7 @@ OSStatus CreateBOINCUsersAndGroups() { return err; if (createdNew) { - endSleep = TickCount() + (2*60); + endSleep = TickCount() + (1*60); while (TickCount() < endSleep) { sleep (1); } @@ -96,7 +96,8 @@ OSStatus SetBOINCAppOwnersGroupsAndPermissions(char *path, char *managerName, Bo err = GetAuthorization(); if (err != noErr) { - ShowSecurityError("SetBOINCAppOwnersGroupsAndPermissions: GetAuthorization returned error %d", err); + if (err != errAuthorizationCanceled) + ShowSecurityError("SetBOINCAppOwnersGroupsAndPermissions: GetAuthorization returned error %d", err); return err; } @@ -139,7 +140,7 @@ OSStatus SetBOINCAppOwnersGroupsAndPermissions(char *path, char *managerName, Bo return err; } - endSleep = TickCount() + (1*60); + endSleep = TickCount() + (30); while (TickCount() < endSleep) { sleep (1); } @@ -180,7 +181,7 @@ OSStatus SetBOINCAppOwnersGroupsAndPermissions(char *path, char *managerName, Bo return err; } - endSleep = TickCount() + (1*60); + endSleep = TickCount() + (30); while (TickCount() < endSleep) { sleep (1); } @@ -236,12 +237,21 @@ OSStatus SetBOINCAppOwnersGroupsAndPermissions(char *path, char *managerName, Bo err = AuthorizationExecuteWithPrivileges (gOurAuthRef, dsclPath, 0, args, NULL); if (err == noErr) break; + + endSleep = TickCount() + (30); + while (TickCount() < endSleep) { + sleep (1); + } + } if (err != noErr) { ShowSecurityError("\"dscl . -create -merge %s users %s\" returned error %d", buf1, getlogin(), err); return err; } + + system("lookupd -flushcache"); + system("memberd -r"); } // End if (development) return err; @@ -325,15 +335,14 @@ static OSStatus CreateUserAndGroup(char * name, Boolean * createdNew) { if (! groupExists) groupid = (gid_t)i; - - break; // Success! } } err = GetAuthorization(); if (err != noErr) { - ShowSecurityError("CreateUserAndGroup: GetAuthorization returned error %d", err); + if (err != errAuthorizationCanceled) + ShowSecurityError("CreateUserAndGroup: GetAuthorization returned error %d", err); return err; } @@ -488,7 +497,7 @@ static OSStatus GetAuthorization (void) { AuthorizationRights ourAuthRights; AuthorizationFlags ourAuthFlags; AuthorizationItem ourAuthItem[RIGHTS_COUNT]; - OSErr err = noErr; + OSStatus err = noErr; if (sIsAuthorized) return noErr;