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

Side by Side Diff: chrome/installer/mac/app/AuthorizedInstall.m

Issue 2394683002: Update comments for AuthorizationExecuteWithPrivileges. (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « base/mac/authorization_util.mm ('k') | 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #import "AuthorizedInstall.h" 5 #import "AuthorizedInstall.h"
6 6
7 @interface AuthorizedInstall () { 7 @interface AuthorizedInstall () {
8 NSFileHandle* communicationFile_; 8 NSFileHandle* communicationFile_;
9 NSString* destinationAppBundlePath_; 9 NSString* destinationAppBundlePath_;
10 } 10 }
(...skipping 17 matching lines...) Expand all
28 28
29 // Starts up the proccess with privileged permissions. 29 // Starts up the proccess with privileged permissions.
30 - (void)startPrivilegedTool:(const char*)toolPath 30 - (void)startPrivilegedTool:(const char*)toolPath
31 withArguments:(const char**)args 31 withArguments:(const char**)args
32 authorization:(AuthorizationRef)authRef 32 authorization:(AuthorizationRef)authRef
33 status:(OSStatus)status { 33 status:(OSStatus)status {
34 if (status != errAuthorizationSuccess) 34 if (status != errAuthorizationSuccess)
35 return; 35 return;
36 36
37 FILE* file; 37 FILE* file;
38 // AuthorizationExecuteWithPrivileges is deprecated in macOS 10.7, but no good
39 // replacement exists. https://crbug.com/593133.
38 #pragma clang diagnostic push 40 #pragma clang diagnostic push
39 #pragma clang diagnostic ignored "-Wdeprecated-declarations" 41 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
40 status = AuthorizationExecuteWithPrivileges( 42 status = AuthorizationExecuteWithPrivileges(
41 authRef, toolPath, kAuthorizationFlagDefaults, (char* const*)args, &file); 43 authRef, toolPath, kAuthorizationFlagDefaults, (char* const*)args, &file);
42 #pragma clang diagnostic pop 44 #pragma clang diagnostic pop
43 communicationFile_ = [[NSFileHandle alloc] initWithFileDescriptor:fileno(file) 45 communicationFile_ = [[NSFileHandle alloc] initWithFileDescriptor:fileno(file)
44 closeOnDealloc:YES]; 46 closeOnDealloc:YES];
45 } 47 }
46 48
47 // Starts up same proccess as above without privileged permissions. 49 // Starts up same proccess as above without privileged permissions.
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 [communicationFile_ writeData:[[message stringByAppendingString:@"\n"] 122 [communicationFile_ writeData:[[message stringByAppendingString:@"\n"]
121 dataUsingEncoding:NSUTF8StringEncoding]]; 123 dataUsingEncoding:NSUTF8StringEncoding]];
122 } 124 }
123 125
124 - (NSString*)startInstall:(NSString*)appBundlePath { 126 - (NSString*)startInstall:(NSString*)appBundlePath {
125 [self sendMessageToTool:appBundlePath]; 127 [self sendMessageToTool:appBundlePath];
126 return destinationAppBundlePath_; 128 return destinationAppBundlePath_;
127 } 129 }
128 130
129 @end 131 @end
OLDNEW
« no previous file with comments | « base/mac/authorization_util.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698