xref: /xnu-8792.41.9/osfmk/man/host_security_create_task_token.html (revision 5c2921b07a2480ab43ec66f5b9e41cb872bc554f)
1*5c2921b0SApple OSS Distributions<h2>host_security_create_task_token</h2>
2*5c2921b0SApple OSS Distributions<hr>
3*5c2921b0SApple OSS Distributions<p>
4*5c2921b0SApple OSS Distributions<strong>Function</strong> - Create a new task with an explicit security token.
5*5c2921b0SApple OSS Distributions<h3>SYNOPSIS</h3>
6*5c2921b0SApple OSS Distributions<pre>
7*5c2921b0SApple OSS Distributions<strong>kern_return_t   host_security_create_task_token</strong>
8*5c2921b0SApple OSS Distributions                <strong>(host_security_t</strong>                  <var>host_security</var>,
9*5c2921b0SApple OSS Distributions                 <strong>task_t</strong>                             <var>parent_task</var>,
10*5c2921b0SApple OSS Distributions                 <strong>security_token_t</strong>                <var>security_token</var>,
11*5c2921b0SApple OSS Distributions                 <strong>audit_token_t</strong>                      <var>audit_token</var>,
12*5c2921b0SApple OSS Distributions                 <strong>ledger_port_array_t</strong>                    <var>ledgers</var>,
13*5c2921b0SApple OSS Distributions                 <strong>boolean_t</strong>                       <var>inherit_memory</var>,
14*5c2921b0SApple OSS Distributions                 <strong>task_t</strong>                             <var>child_task</var><strong>);</strong>
15*5c2921b0SApple OSS Distributions</pre>
16*5c2921b0SApple OSS Distributions<h3>PARAMETERS</h3>
17*5c2921b0SApple OSS Distributions<dl>
18*5c2921b0SApple OSS Distributions<p>
19*5c2921b0SApple OSS Distributions<dt><var>host_security</var>
20*5c2921b0SApple OSS Distributions<dd>
21*5c2921b0SApple OSS Distributions[in security send right] The host's security port.
22*5c2921b0SApple OSS Distributions<p>
23*5c2921b0SApple OSS Distributions<dt><var>parent_task</var>
24*5c2921b0SApple OSS Distributions<dd>
25*5c2921b0SApple OSS Distributions[in task send right] The port for the task from which to draw the child
26*5c2921b0SApple OSS Distributionstask's port rights and address space.
27*5c2921b0SApple OSS Distributions<p>
28*5c2921b0SApple OSS Distributions<dt><var>security_token</var>
29*5c2921b0SApple OSS Distributions<dd>
30*5c2921b0SApple OSS Distributions[in scalar] The task's security token.
31*5c2921b0SApple OSS Distributions<p>
32*5c2921b0SApple OSS Distributions<dt><var>audit_token</var>
33*5c2921b0SApple OSS Distributions<dd>
34*5c2921b0SApple OSS Distributions[in scalar] The task's audit token.
35*5c2921b0SApple OSS Distributions<p>
36*5c2921b0SApple OSS Distributions<dt><var>ledgers</var>
37*5c2921b0SApple OSS Distributions<dd>
38*5c2921b0SApple OSS Distributions[pointer to in array of ledger send rights] The set of ledgers from which the
39*5c2921b0SApple OSS Distributionstask will draw its resources.
40*5c2921b0SApple OSS Distributions<p>
41*5c2921b0SApple OSS Distributions<dt><var>inherit_memory</var>
42*5c2921b0SApple OSS Distributions<dd>
43*5c2921b0SApple OSS Distributions[in scalar] Address space inheritance indicator. If true, the child task in-
44*5c2921b0SApple OSS Distributionsherits the address space of the parent task. If false, the kernel assigns
45*5c2921b0SApple OSS Distributionsthe child task an empty address space.
46*5c2921b0SApple OSS Distributions<p>
47*5c2921b0SApple OSS Distributions<dt><var>child_task</var>
48*5c2921b0SApple OSS Distributions<dd>
49*5c2921b0SApple OSS Distributions[out task send right] The kernel-assigned port name for the new task.
50*5c2921b0SApple OSS Distributions</dl>
51*5c2921b0SApple OSS Distributions<h3>DESCRIPTION</h3>
52*5c2921b0SApple OSS Distributions<p>
53*5c2921b0SApple OSS DistributionsThe <strong><strong>host_security_create_task_token</strong> function creates a new task from
54*5c2921b0SApple OSS Distributions<var>parent_task</var> with explicit security and audit token values, returning the name of the
55*5c2921b0SApple OSS Distributionsnew task in the parameter specified by <var>child_task</var>. Other than the security and audit token values, the child task
56*5c2921b0SApple OSS Distributionsis as if created by <strong>task_create</strong>.
57*5c2921b0SApple OSS Distributions<h3>NOTES</h3>
58*5c2921b0SApple OSS Distributions<p>
59*5c2921b0SApple OSS DistributionsThe host security port is a privileged port given to the system
60*5c2921b0SApple OSS Distributionsbootstrap task for the use of this call.
61*5c2921b0SApple OSS Distributions<h3>RETURN VALUES</h3>
62*5c2921b0SApple OSS Distributions<dl>
63*5c2921b0SApple OSS Distributions<p>
64*5c2921b0SApple OSS Distributions<dt> <strong>KERN_INVALID_SECURITY</strong>
65*5c2921b0SApple OSS Distributions<dd>
66*5c2921b0SApple OSS DistributionsThe value of <var>host_security</var> does not specify the security port for the host on which task lies.
67*5c2921b0SApple OSS Distributions</dl>
68*5c2921b0SApple OSS Distributions<h3>RELATED INFORMATION</h3>
69*5c2921b0SApple OSS Distributions<p>
70*5c2921b0SApple OSS DistributionsFunctions:
71*5c2921b0SApple OSS Distributions<a href="task_create.html"><strong>task_create</strong></a>,
72*5c2921b0SApple OSS Distributions<a href="host_security_set_task_token.html"><strong>host_security_set_task_token</strong></a>,
73*5c2921b0SApple OSS Distributions<a href="mach_msg.html"><strong>mach_msg</strong></a>.
74