Added clean exit if user fails to enter a valid administrator password in Mac OS X authentication dialog.
This commit is contained in:
parent
1bd1c7233f
commit
0441508574
1 changed files with 5 additions and 3 deletions
|
|
@ -496,7 +496,7 @@ static void CustomApplicationMain (argc, argv)
|
|||
return (BOOL)result;
|
||||
}
|
||||
|
||||
- (OSStatus) installFontconfigFilesWithAuthorization
|
||||
- (BOOL) installFontconfigFilesWithAuthorization
|
||||
{
|
||||
OSStatus status;
|
||||
AuthorizationFlags flags = kAuthorizationFlagDefaults;
|
||||
|
|
@ -514,7 +514,6 @@ static void CustomApplicationMain (argc, argv)
|
|||
status = AuthorizationCopyRights(authorizationRef, &rights, NULL, flags, NULL);
|
||||
|
||||
if (status == errAuthorizationSuccess)
|
||||
|
||||
{
|
||||
NSString *fcInstallerPath = [bundle pathForAuxiliaryExecutable:@"fcinstaller"];
|
||||
|
||||
|
|
@ -531,7 +530,7 @@ static void CustomApplicationMain (argc, argv)
|
|||
}
|
||||
|
||||
AuthorizationFree(authorizationRef, kAuthorizationFlagDefaults);
|
||||
return status;
|
||||
return (status == errAuthorizationSuccess);
|
||||
}
|
||||
|
||||
- (BOOL) fontconfigFilesAreInstalled
|
||||
|
|
@ -561,6 +560,9 @@ static void CustomApplicationMain (argc, argv)
|
|||
if (!filesExist)
|
||||
{
|
||||
[self installFontconfigFilesWithAuthorization];
|
||||
filesExist = [self fontconfigFilesAreInstalled];
|
||||
if (!filesExist)
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue