File: security_class_to_string.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 (80 lines) | stat: -rw-r--r-- 2,302 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
69
70
71
72
73
74
75
76
77
78
79
80
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Author: Eamon Walsh (ewalsh@tycho.nsa.gov) 2007
.TH "security_class_to_string" "3" "30 Mar 2007" "" "SELinux API documentation"
.SH "NAME"
security_class_to_string, security_av_perm_to_string, string_to_security_class, string_to_av_perm, security_av_string \- convert
between SELinux class and permission values and string names.

.SH "SYNOPSIS"
.B #include <selinux/selinux.h>

.B #include <selinux/flask.h>
.sp
.BI "const char * security_class_to_string(security_class_t " tclass ");"
.sp
.BI "const char * security_av_perm_to_string(security_class_t " tclass ", access_vector_t " av ");"
.sp
.BI "int security_av_string(security_class_t " tclass ", access_vector_t " av ", char **" result ");"
.sp
.BI "security_class_t string_to_security_class(const char *" name ");"
.sp
.BI "access_vector_t string_to_av_perm(security_class_t " tclass ", const char *" name ");"

.SH "DESCRIPTION"
.B security_class_to_string
returns a string name for class
.IR tclass ,
or NULL if the class is invalid.  The returned string must not be modified or freed.

.B security_av_perm_to_string
returns a string name for the access vector bit
.I av
of class
.IR tclass ,
or NULL if either argument is invalid.  The returned string must not be modified or freed.

.B security_av_string
computes a full access vector string representation using
.I tclass
and
.IR av ,
which may have multiple bits set.  The string is returned in the memory pointed to by
.IR result ,
and should be freed by the caller using
.BR free (3).

.B string_to_security_class
returns the class value corresponding to the string name
.IR name ,
or zero if no such class exists.

.B string_to_av_perm
returns the access vector bit corresponding to the string name
.I name
and security class
.IR tclass ,
or zero if no such value exists.

.SH "RETURN VALUE"
.B security_av_string
returns returns zero on success or \-1 on error with
.I errno
set appropriately.  All other functions return zero or NULL on error.

.SH "ERRORS"
.TP
.B EINVAL
A class or access vector argument is not recognized by the currently loaded policy.

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

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

.SH "SEE ALSO"
.BR selinux (8),
.BR getcon (3),
.BR getfilecon (3)