objc2_security/
authorization.rs

1use core::ffi::c_char;
2use core::ptr::NonNull;
3
4use crate::{AuthorizationFlags, AuthorizationRef, AuthorizationString, OSStatus};
5
6// Manual re-definition: see #711.
7extern "C-unwind" {
8    /// Run an executable tool with enhanced privileges after passing
9    /// suitable authorization procedures.
10    ///
11    ///
12    /// Parameter `authorization`: An authorization reference that is used to authorize
13    /// access to the enhanced privileges. It is also passed to the tool for
14    /// further access control.
15    ///
16    /// Parameter `pathToTool`: Full pathname to the tool that should be executed
17    /// with enhanced privileges.
18    ///
19    /// Parameter `options`: Option bits (reserved). Must be zero.
20    ///
21    /// Parameter `arguments`: An argv-style vector of strings to be passed to the tool.
22    ///
23    /// Parameter `communicationsPipe`: Assigned a UNIX stdio FILE pointer for
24    /// a bidirectional pipe to communicate with the tool. The tool will have
25    /// this pipe as its standard I/O channels (stdin/stdout). If NULL, do not
26    /// establish a communications pipe.
27    ///
28    ///
29    /// This function has been deprecated and should no longer be used.
30    /// Use a launchd-launched helper tool and/or the Service Management framework
31    /// for this functionality.
32    #[deprecated]
33    pub fn AuthorizationExecuteWithPrivileges(
34        authorization: AuthorizationRef,
35        path_to_tool: NonNull<c_char>,
36        options: AuthorizationFlags,
37        arguments: NonNull<AuthorizationString>,
38        communications_pipe: *mut *mut libc::FILE,
39    ) -> OSStatus;
40}