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

Side by Side Diff: base/mac/authorization_util.mm

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 | « no previous file | chrome/installer/mac/app/AuthorizedInstall.m » ('j') | 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 "base/mac/authorization_util.h" 5 #include "base/mac/authorization_util.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <sys/wait.h> 9 #include <sys/wait.h>
10 10
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // pipe may be NULL, but this function needs one. In that case, use a local 101 // pipe may be NULL, but this function needs one. In that case, use a local
102 // pipe. 102 // pipe.
103 FILE* local_pipe; 103 FILE* local_pipe;
104 FILE** pipe_pointer; 104 FILE** pipe_pointer;
105 if (pipe) { 105 if (pipe) {
106 pipe_pointer = pipe; 106 pipe_pointer = pipe;
107 } else { 107 } else {
108 pipe_pointer = &local_pipe; 108 pipe_pointer = &local_pipe;
109 } 109 }
110 110
111 // Deprecated in OS X 10.7. https://crbug.com/592663. 111 // AuthorizationExecuteWithPrivileges is deprecated in macOS 10.7, but no good
112 // replacement exists. https://crbug.com/593133.
112 #pragma clang diagnostic push 113 #pragma clang diagnostic push
113 #pragma clang diagnostic ignored "-Wdeprecated-declarations" 114 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
114 // AuthorizationExecuteWithPrivileges wants |char* const*| for |arguments|, 115 // AuthorizationExecuteWithPrivileges wants |char* const*| for |arguments|,
115 // but it doesn't actually modify the arguments, and that type is kind of 116 // but it doesn't actually modify the arguments, and that type is kind of
116 // silly and callers probably aren't dealing with that. Put the cast here 117 // silly and callers probably aren't dealing with that. Put the cast here
117 // to make things a little easier on callers. 118 // to make things a little easier on callers.
118 OSStatus status = AuthorizationExecuteWithPrivileges(authorization, 119 OSStatus status = AuthorizationExecuteWithPrivileges(authorization,
119 tool_path, 120 tool_path,
120 options, 121 options,
121 (char* const*)arguments, 122 (char* const*)arguments,
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 192 }
192 } else { 193 } else {
193 *exit_status_pointer = -1; 194 *exit_status_pointer = -1;
194 } 195 }
195 196
196 return status; 197 return status;
197 } 198 }
198 199
199 } // namespace mac 200 } // namespace mac
200 } // namespace base 201 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | chrome/installer/mac/app/AuthorizedInstall.m » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698