diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-16 23:34:12 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-16 23:34:12 +0000 |
commit | c863478d1a9d9e948f58e329ceb9d5f9d2f959dd (patch) | |
tree | 0a7ff047fcb0091600f9bc66ab53256dbeca5101 /chrome/installer/gcapi_mac/gcapi.mm | |
parent | 27798ec69952c2987ca5b1891ac3e5aee544821f (diff) | |
download | chromium_src-c863478d1a9d9e948f58e329ceb9d5f9d2f959dd.zip chromium_src-c863478d1a9d9e948f58e329ceb9d5f9d2f959dd.tar.gz chromium_src-c863478d1a9d9e948f58e329ceb9d5f9d2f959dd.tar.bz2 |
gcapi mac: If a system ticket points to a nonexistent folder, also set 'access denied'.
That way, installers can opt to not call LaunchGoogleChrome() for
system installs.
Also add a few null checks if getting the effective user fails.
BUG=none
Review URL: https://codereview.chromium.org/11308079
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168329 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/gcapi_mac/gcapi.mm')
-rw-r--r-- | chrome/installer/gcapi_mac/gcapi.mm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/installer/gcapi_mac/gcapi.mm b/chrome/installer/gcapi_mac/gcapi.mm index 9540966..e2f9e6a 100644 --- a/chrome/installer/gcapi_mac/gcapi.mm +++ b/chrome/installer/gcapi_mac/gcapi.mm @@ -315,12 +315,18 @@ int GoogleChromeCompatibilityCheck(unsigned* reasons) { unsigned local_reasons = 0; @autoreleasepool { passwd* user = GetRealUserId(); + if (!user) + return GCCC_ERROR_ACCESSDENIED; if (!IsOSXVersionSupported()) local_reasons |= GCCC_ERROR_OSNOTSUPPORTED; - if (FindChromeTicket(kSystemTicket, NULL, NULL)) + NSString* path; + if (FindChromeTicket(kSystemTicket, NULL, &path)) { local_reasons |= GCCC_ERROR_ALREADYPRESENT; + if (!path) // Ticket points to nothingness. + local_reasons |= GCCC_ERROR_ACCESSDENIED; + } if (FindChromeTicket(kUserTicket, user, NULL)) local_reasons |= GCCC_ERROR_ALREADYPRESENT; @@ -345,6 +351,8 @@ int InstallGoogleChrome(const char* source_path, @autoreleasepool { passwd* user = GetRealUserId(); + if (!user) + return 0; NSString* app_path = [NSString stringWithUTF8String:source_path]; NSString* info_plist_path = @@ -403,6 +411,8 @@ int InstallGoogleChrome(const char* source_path, int LaunchGoogleChrome() { @autoreleasepool { passwd* user = GetRealUserId(); + if (!user) + return 0; NSString* app_path; |