xref: /xnu-10063.121.3/osfmk/man/host_security_set_task_token.html (revision 2c2f96dc2b9a4408a43d3150ae9c105355ca3daa)
1*2c2f96dcSApple OSS Distributions<h2>host_security_set_task_token</h2>
2*2c2f96dcSApple OSS Distributions<hr>
3*2c2f96dcSApple OSS Distributions<p>
4*2c2f96dcSApple OSS Distributions<strong>Function</strong> - Change the target task's security token.
5*2c2f96dcSApple OSS Distributions<h3>SYNOPSIS</h3>
6*2c2f96dcSApple OSS Distributions<pre>
7*2c2f96dcSApple OSS Distributions<strong>kern_return_t   host_security_set_task_token</strong>
8*2c2f96dcSApple OSS Distributions                <strong>(host_security_t</strong>                  <var>host_security</var>,
9*2c2f96dcSApple OSS Distributions                 <strong>task_t</strong>                                    <var>task</var>,
10*2c2f96dcSApple OSS Distributions                 <strong>security_token_t</strong>                <var>security_token</var>,
11*2c2f96dcSApple OSS Distributions                 <strong>audit_token_t</strong>                      <var>audit_token</var>,
12*2c2f96dcSApple OSS Distributions                 <strong>host_t</strong>                                    <var>host</var><strong>);</strong>
13*2c2f96dcSApple OSS Distributions</pre>
14*2c2f96dcSApple OSS Distributions<h3>PARAMETERS</h3>
15*2c2f96dcSApple OSS Distributions<dl>
16*2c2f96dcSApple OSS Distributions<p>
17*2c2f96dcSApple OSS Distributions<dt><var>host_security</var>
18*2c2f96dcSApple OSS Distributions<dd>
19*2c2f96dcSApple OSS Distributions[in security send right] The host's security port.
20*2c2f96dcSApple OSS Distributions<p>
21*2c2f96dcSApple OSS Distributions<dt><var>task</var>
22*2c2f96dcSApple OSS Distributions<dd>
23*2c2f96dcSApple OSS Distributions[in task send right] The port for the task for which the token is to be set.
24*2c2f96dcSApple OSS Distributions<p>
25*2c2f96dcSApple OSS Distributions<dt><var>security_token</var>
26*2c2f96dcSApple OSS Distributions<dd>
27*2c2f96dcSApple OSS Distributions[in scalar] The new security token.
28*2c2f96dcSApple OSS Distributions<p>
29*2c2f96dcSApple OSS Distributions<dt><var>audit_token</var>
30*2c2f96dcSApple OSS Distributions<dd>
31*2c2f96dcSApple OSS Distributions[in scalar] The new audit token.
32*2c2f96dcSApple OSS Distributions<p>
33*2c2f96dcSApple OSS Distributions<dt><var>host</var>
34*2c2f96dcSApple OSS Distributions<dd>
35*2c2f96dcSApple OSS Distributions[in host send right] The task's new host-self port.
36*2c2f96dcSApple OSS Distributions</dl>
37*2c2f96dcSApple OSS Distributions<h3>DESCRIPTION</h3>
38*2c2f96dcSApple OSS Distributions<p>
39*2c2f96dcSApple OSS DistributionsThe <strong>host_security_set_task_token</strong> function changes the
40*2c2f96dcSApple OSS Distributionsspecified task's security and audit tokens; the new tokens will be
41*2c2f96dcSApple OSS Distributionsincluded in all subsequent messages sent from the task. The
42*2c2f96dcSApple OSS Distributionsinitial value of a task's security and audit tokens is that of its
43*2c2f96dcSApple OSS Distributionsparent.
44*2c2f96dcSApple OSS Distributions<h3>NOTES</h3>
45*2c2f96dcSApple OSS Distributions<p>
46*2c2f96dcSApple OSS DistributionsThe host security port is a privileged port given to the system
47*2c2f96dcSApple OSS Distributionsbootstrap task for the use of this call.
48*2c2f96dcSApple OSS Distributions<h3>RETURN VALUES</h3>
49*2c2f96dcSApple OSS Distributions<dl>
50*2c2f96dcSApple OSS Distributions<p>
51*2c2f96dcSApple OSS Distributions<dt> <strong>KERN_INVALID_SECURITY</strong>
52*2c2f96dcSApple OSS Distributions<dd>
53*2c2f96dcSApple OSS DistributionsThe value of <var>host_security</var> does not specify the security port for the host on which task lies.
54*2c2f96dcSApple OSS Distributions</dl>
55*2c2f96dcSApple OSS Distributions<h3>RELATED INFORMATION</h3>
56*2c2f96dcSApple OSS Distributions<p>
57*2c2f96dcSApple OSS DistributionsFunctions:
58*2c2f96dcSApple OSS Distributions<a href="task_create.html"><strong>task_create</strong></a>,
59*2c2f96dcSApple OSS Distributions<a href="task_info.html"><strong>task_info</strong></a>,
60*2c2f96dcSApple OSS Distributions<a href="mach_msg.html"><strong>mach_msg</strong></a>.
61