-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix(Security): Re-define AuthorizationExecuteWithPrivileges
Fixes #711. Signed-off-by: Paul Mabileau <[email protected]>
- Loading branch information
Showing
4 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#[cfg(feature = "libc")] | ||
use core::ptr::NonNull; | ||
#[cfg(feature = "libc")] | ||
use core::ffi::c_char; | ||
|
||
#[cfg(feature = "libc")] | ||
use crate::{AuthorizationFlags, AuthorizationRef, AuthorizationString, OSStatus}; | ||
|
||
// Manual re-definition: see #711. | ||
extern "C-unwind" { | ||
/// Run an executable tool with enhanced privileges after passing | ||
/// suitable authorization procedures. | ||
/// | ||
/// | ||
/// Parameter `authorization`: An authorization reference that is used to authorize | ||
/// access to the enhanced privileges. It is also passed to the tool for | ||
/// further access control. | ||
/// | ||
/// Parameter `pathToTool`: Full pathname to the tool that should be executed | ||
/// with enhanced privileges. | ||
/// | ||
/// Parameter `options`: Option bits (reserved). Must be zero. | ||
/// | ||
/// Parameter `arguments`: An argv-style vector of strings to be passed to the tool. | ||
/// | ||
/// Parameter `communicationsPipe`: Assigned a UNIX stdio FILE pointer for | ||
/// a bidirectional pipe to communicate with the tool. The tool will have | ||
/// this pipe as its standard I/O channels (stdin/stdout). If NULL, do not | ||
/// establish a communications pipe. | ||
/// | ||
/// | ||
/// This function has been deprecated and should no longer be used. | ||
/// Use a launchd-launched helper tool and/or the Service Mangement framework | ||
/// for this functionality. | ||
#[cfg(feature = "libc")] | ||
#[deprecated] | ||
pub fn AuthorizationExecuteWithPrivileges( | ||
authorization: AuthorizationRef, | ||
path_to_tool: NonNull<c_char>, | ||
options: AuthorizationFlags, | ||
arguments: NonNull<AuthorizationString>, | ||
communications_pipe: *mut *mut libc::FILE, | ||
) -> OSStatus; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters