Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4552)

Unified Diff: chrome/installer/gcapi_mac/gcapi.mm

Issue 2151503002: gcapi_mac: Fix GoogleChromeCompatibilityCheck() return value (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/gcapi_mac/gcapi.mm
diff --git a/chrome/installer/gcapi_mac/gcapi.mm b/chrome/installer/gcapi_mac/gcapi.mm
index 798a53966f83776cdd58dd17497e1f12c7695a3d..25e0497c2e52347ea5005af8278c9f68e0ea7fa8 100644
--- a/chrome/installer/gcapi_mac/gcapi.mm
+++ b/chrome/installer/gcapi_mac/gcapi.mm
@@ -312,10 +312,6 @@ bool isbrandchar(int c) {
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;
@@ -326,7 +322,10 @@ int GoogleChromeCompatibilityCheck(unsigned* reasons) {
local_reasons |= GCCC_ERROR_ACCESSDENIED;
}
- if (FindChromeTicket(kUserTicket, user, NULL))
+ passwd* user = GetRealUserId();
+ if (!user)
+ local_reasons |= GCCC_ERROR_ACCESSDENIED;
+ else if (FindChromeTicket(kUserTicket, user, NULL))
local_reasons |= GCCC_ERROR_ALREADYPRESENT;
if ([[NSFileManager defaultManager] fileExistsAtPath:kChromeInstallPath])
@@ -337,8 +336,8 @@ int GoogleChromeCompatibilityCheck(unsigned* reasons) {
isWritableFileAtPath:@"/Applications"])
local_reasons |= GCCC_ERROR_ACCESSDENIED;
}
-
}
+
if (reasons != NULL)
*reasons = local_reasons;
return local_reasons == 0;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698