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;
|
return (BOOL)result;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (OSStatus) installFontconfigFilesWithAuthorization
|
- (BOOL) installFontconfigFilesWithAuthorization
|
||||||
{
|
{
|
||||||
OSStatus status;
|
OSStatus status;
|
||||||
AuthorizationFlags flags = kAuthorizationFlagDefaults;
|
AuthorizationFlags flags = kAuthorizationFlagDefaults;
|
||||||
|
|
@ -514,7 +514,6 @@ static void CustomApplicationMain (argc, argv)
|
||||||
status = AuthorizationCopyRights(authorizationRef, &rights, NULL, flags, NULL);
|
status = AuthorizationCopyRights(authorizationRef, &rights, NULL, flags, NULL);
|
||||||
|
|
||||||
if (status == errAuthorizationSuccess)
|
if (status == errAuthorizationSuccess)
|
||||||
|
|
||||||
{
|
{
|
||||||
NSString *fcInstallerPath = [bundle pathForAuxiliaryExecutable:@"fcinstaller"];
|
NSString *fcInstallerPath = [bundle pathForAuxiliaryExecutable:@"fcinstaller"];
|
||||||
|
|
||||||
|
|
@ -531,7 +530,7 @@ static void CustomApplicationMain (argc, argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
AuthorizationFree(authorizationRef, kAuthorizationFlagDefaults);
|
AuthorizationFree(authorizationRef, kAuthorizationFlagDefaults);
|
||||||
return status;
|
return (status == errAuthorizationSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) fontconfigFilesAreInstalled
|
- (BOOL) fontconfigFilesAreInstalled
|
||||||
|
|
@ -561,6 +560,9 @@ static void CustomApplicationMain (argc, argv)
|
||||||
if (!filesExist)
|
if (!filesExist)
|
||||||
{
|
{
|
||||||
[self installFontconfigFilesWithAuthorization];
|
[self installFontconfigFilesWithAuthorization];
|
||||||
|
filesExist = [self fontconfigFilesAreInstalled];
|
||||||
|
if (!filesExist)
|
||||||
|
exit(-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue