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

Side by Side Diff: chrome/installer/gcapi_mac/gcapi.mm

Issue 10824285: gcapi/mac: Prevent "unknown binary" stderr output from sudo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/installer/gcapi_mac/gcapi.h" 5 #include "chrome/installer/gcapi_mac/gcapi.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 #include <grp.h> 8 #include <grp.h>
9 #include <pwd.h> 9 #include <pwd.h>
10 #include <sys/stat.h> 10 #include <sys/stat.h>
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // Don't use Objective-C 2 loop syntax, in case an installer runs on 10.4. 101 // Don't use Objective-C 2 loop syntax, in case an installer runs on 10.4.
102 NSMutableArray* keystone_paths = 102 NSMutableArray* keystone_paths =
103 [NSMutableArray arrayWithObject:kSystemKsadminPath]; 103 [NSMutableArray arrayWithObject:kSystemKsadminPath];
104 if (kind == kUserTicket) { 104 if (kind == kUserTicket) {
105 [keystone_paths insertObject:AdjustHomedir(kUserKsadminPath, user->pw_dir) 105 [keystone_paths insertObject:AdjustHomedir(kUserKsadminPath, user->pw_dir)
106 atIndex:0]; 106 atIndex:0];
107 } 107 }
108 NSEnumerator* e = [keystone_paths objectEnumerator]; 108 NSEnumerator* e = [keystone_paths objectEnumerator];
109 id ks_path; 109 id ks_path;
110 while ((ks_path = [e nextObject])) { 110 while ((ks_path = [e nextObject])) {
111 if (![[NSFileManager defaultManager] fileExistsAtPath:ks_path])
112 continue;
113
111 NSTask* task = nil; 114 NSTask* task = nil;
112 NSString* string = nil; 115 NSString* string = nil;
113 bool ksadmin_ran_successfully = false; 116 bool ksadmin_ran_successfully = false;
114 117
115 @try { 118 @try {
116 task = [[NSTask alloc] init]; 119 task = [[NSTask alloc] init];
117 [task setLaunchPath:ks_path]; 120 [task setLaunchPath:ks_path];
118 121
119 NSArray* arguments = @[ 122 NSArray* arguments = @[
120 kind == kUserTicket ? @"--user-store" : @"--system-store", 123 kind == kUserTicket ? @"--user-store" : @"--system-store",
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 return 1; 361 return 1;
359 } 362 }
360 363
361 int LaunchGoogleChrome() { 364 int LaunchGoogleChrome() {
362 @autoreleasepool { 365 @autoreleasepool {
363 // NSWorkspace launches processes as the current console owner, 366 // NSWorkspace launches processes as the current console owner,
364 // even when running with euid of 0. 367 // even when running with euid of 0.
365 return [[NSWorkspace sharedWorkspace] launchApplication:kChromeInstallPath]; 368 return [[NSWorkspace sharedWorkspace] launchApplication:kChromeInstallPath];
366 } 369 }
367 } 370 }
OLDNEW
« 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