Debian Codegraph @

libselinux/man/man3/avc_compute_create.3

raw
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Author: Eamon Walsh ([email protected]) 2007
4 .TH "avc_compute_create" "3" "30 Mar 2007" "" "SELinux API documentation"
5 .SH "NAME"
6 avc_compute_create, avc_compute_member \- obtain SELinux label for new object
7 .
8 .SH "SYNOPSIS"
9 .B #include <selinux/selinux.h>
10 .br
11 .B #include <selinux/avc.h>
12 .sp
13 .BI "int avc_compute_create(security_id_t " ssid ", security_id_t " tsid ,
14 .in +\w'int avc_compute_create('u
15 .BI "security_class_t " tclass ", security_id_t *" newsid ");"
16 .sp
17 .in
18 .BI "int avc_compute_member(security_id_t " ssid ", security_id_t " tsid ,
19 .in +\w'int avc_compute_member('u
20 .BI "security_class_t " tclass ", security_id_t *" newsid ");"
21 .in
22 .
23 .SH "DESCRIPTION"
24 .BR avc_compute_create ()
25 is used to compute a SID to use for labeling a new object in a particular class based on a SID pair. This call is identical to
26 .BR security_compute_create (),
27 but does not require converting from userspace SID's to contexts and back again.
28
29 .BR avc_compute_member ()
30 is used to compute a SID to use for labeling a polyinstantiated object instance of a particular class based on a SID pair. This call is identical to
31 .BR security_compute_member (),
32 but does not require converting from userspace SID's to contexts and back again.
33
34 These functions
35 return a SID for the computed context in the memory referenced by
36 .IR sid .
37 .
38 .SH "RETURN VALUE"
39 On success, zero is returned. On error, \-1 is returned and
40 .I errno
41 is set appropriately.
42 .
43 .SH "ERRORS"
44 .TP
45 .B EINVAL
46 The
47 .I tclass
48 and/or the security contexts referenced by
49 .I ssid
50 and
51 .I tsid
52 are not recognized by the currently loaded policy.
53 .TP
54 .B ENOMEM
55 An attempt to allocate memory failed.
56 .
57 .SH "AUTHOR"
58 Eamon Walsh <[email protected]>
59 .
60 .SH "SEE ALSO"
61 .BR avc_init (3),
62 .BR avc_context_to_sid (3),
63 .BR security_compute_create (3),
64 .BR selinux (8)