File: avc_compute_create.3

package info (click to toggle)
libselinux 2.0.65-5
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 1,660 kB
  • ctags: 2,682
  • sloc: ansic: 18,495; python: 296; sh: 195; makefile: 183
file content (68 lines) | stat: -rw-r--r-- 1,948 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Author: Eamon Walsh (ewalsh@tycho.nsa.gov) 2007
.TH "avc_compute_create" "3" "30 Mar 2007" "" "SELinux API documentation"
.SH "NAME"
avc_compute_create, avc_compute_member \- obtain SELinux label for new object.
.SH "SYNOPSIS"
.B #include <selinux/selinux.h>

.B #include <selinux/avc.h>
.sp
.BI "int avc_compute_create(security_id_t " ssid ", security_id_t " tsid ,
.in +\w'int avc_compute_create('u
.BI "security_class_t " tclass ", security_id_t *" newsid ");"
.sp
.in
.BI "int avc_compute_member(security_id_t " ssid ", security_id_t " tsid ,
.in +\w'int avc_compute_member('u
.BI "security_class_t " tclass ", security_id_t *" newsid ");"
.in
.SH "DESCRIPTION"
.B avc_compute_create
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
.BR security_compute_create ,
but does not require converting from userspace SID's to contexts and back again.

.B avc_compute_member
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
.BR security_compute_member ,
but does not require converting from userspace SID's to contexts and back again.

These functions
return a SID for the computed context in the memory referenced by
.IR sid ,
incrementing its reference count by 1.

.SH "RETURN VALUE"
On success, zero is returned.  On error, \-1 is returned and
.I errno
is set appropriately.

.SH "ERRORS"
.TP
.B EINVAL
The
.I tclass
and/or the security contexts referenced by
.I ssid
and
.I tsid
are not recognized by the currently loaded policy, or 
.I tsid
or
.I ssid
has a zero reference count and is invalid.

.TP
.B ENOMEM
An attempt to allocate memory failed.

.SH "AUTHOR"
Eamon Walsh <ewalsh@tycho.nsa.gov>

.SH "SEE ALSO"
.BR avc_init (3),
.BR avc_context_to_sid (3),
.BR security_compute_create (3),
.BR selinux (8)