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  -  convert  between
8       SELinux class and permission values and string names.
9
10       print_access_vector - display an access vector in human-readable form.
11
12

SYNOPSIS

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

DESCRIPTION

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

ERRORS

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

AUTHOR

74       Eamon Walsh <ewalsh@tycho.nsa.gov>
75
76

SEE ALSO

78       selinux(8), getcon(3), getfilecon(3)
79
80
81
82                                  30 Mar 2007      security_class_to_string(3)
Impressum