pub unsafe extern "C-unwind" fn SessionCreate(
flags: SessionCreationFlags,
attributes: SessionAttributeBits,
) -> i32
AuthSession
only.Expand description
This (very specialized) function creates a security session. Upon completion, the new session contains the calling process (and none other). You cannot create a session for someone else, and cannot avoid being placed into the new session. This is (currently) the only call that changes a process’s session membership. By default, a new bootstrap subset port is created for the calling process. The process acquires this new port as its bootstrap port, which all its children will inherit. If you happen to have created the subset port on your own, you can pass the sessionKeepCurrentBootstrap flag, and SessionCreate will use it. Note however that you cannot supersede a prior SessionCreate call that way; only a single SessionCreate call is allowed for each Session (however made). This call will discard any security information established for the calling process. In particular, any authorization handles acquired will become invalid, and so will any keychain related information. We recommend that you call SessionCreate before making any other security-related calls that establish rights of any kind, to the extent this is practical. Also, we strongly recommend that you do not perform security-related calls in any other threads while calling SessionCreate.
Parameter flags
: Flags controlling how the session is created.
Parameter attributes
: The set of attribute bits to set for the new session.
Not all bits can be set this way.
Returns: An OSStatus indicating success (errSecSuccess) or an error cause.
errSessionInvalidAttributes -60501 Attempt to set invalid attribute bits errSessionAuthorizationDenied -60502 Attempt to re-initialize a session errSessionInvalidFlags -60011 Attempt to specify unsupported flag bits