1security_class_to_string(3)SELinux API documentationsecurity_class_to_string(3)
2
3
4

NAME

6       security_class_to_string,  security_av_perm_to_string,  string_to_secu‐
7       rity_class,   string_to_av_perm,   security_av_string,    mode_to_secu‐
8       rity_class  -  convert  between SELinux class and permission values and
9       string names.  print_access_vector - display an access vector in human-
10       readable form.
11

SYNOPSIS

13       #include <selinux/selinux.h>
14
15       const char *security_class_to_string(security_class_t tclass);
16
17       const    char    *security_av_perm_to_string(security_class_t   tclass,
18       access_vector_t av);
19
20       int  security_av_string(security_class_t  tclass,  access_vector_t  av,
21       char **result);
22
23       security_class_t string_to_security_class(const char *name);
24
25       security_class_t mode_to_security_class(mode_t mode);
26
27       access_vector_t  string_to_av_perm(security_class_t  tclass, const char
28       *name);
29
30       void print_access_vector(security_class_t tclass, access_vector_t av);
31

DESCRIPTION

33       security_class_to_string() returns a string name for class  tclass,  or
34       NULL if the class is invalid.  The returned string must not be modified
35       or freed.
36
37       security_av_perm_to_string() returns a string name for the access  vec‐
38       tor bit av of class tclass, or NULL if either argument is invalid.  The
39       returned string must not be modified or freed.
40
41       security_av_string() computes a full access vector  string  representa‐
42       tion using tclass and av, which may have multiple bits set.  The string
43       is returned in the memory pointed to by result, and should be freed  by
44       the caller using free(3).
45
46       string_to_security_class() returns the class value corresponding to the
47       string name name, or zero if no such class exists.
48
49       mode_to_security_class() returns the class value corresponding  to  the
50       specified mode, or zero if no such class exists.
51
52       string_to_av_perm()  returns the access vector bit corresponding to the
53       string name name and security class tclass, or zero if  no  such  value
54       exists.
55
56       print_access_vector()  displays an access vector in human-readable form
57       on the standard output stream.
58

RETURN VALUE

60       security_av_string() returns zero on success or -1 on error with  errno
61       set  appropriately.  print_access_vector() does not return a value. All
62       other functions return zero or NULL on error.
63

ERRORS

65       EINVAL A class or access vector argument is not recognized by the  cur‐
66              rently loaded policy.
67
68
69       ENOMEM An attempt to allocate memory failed.
70

AUTHOR

72       Eamon Walsh <ewalsh@tycho.nsa.gov>
73

SEE ALSO

75       selinux(8), getcon(3), getfilecon(3) stat(3)
76
77
78
79                                  30 Mar 2007      security_class_to_string(3)
Impressum