Blame man/man3/security_class_to_string.3

Packit 3feee0
.\" Hey Emacs! This file is -*- nroff -*- source.
Packit 3feee0
.\"
Packit 3feee0
.\" Author: Eamon Walsh (ewalsh@tycho.nsa.gov) 2007
Packit 3feee0
.TH "security_class_to_string" "3" "30 Mar 2007" "" "SELinux API documentation"
Packit 3feee0
.SH "NAME"
Packit 3feee0
security_class_to_string, security_av_perm_to_string, string_to_security_class, string_to_av_perm, security_av_string, mode_to_security_class \- convert
Packit 3feee0
between SELinux class and permission values and string names.
Packit 3feee0
.
Packit 3feee0
print_access_vector \- display an access vector in human-readable form. 
Packit 3feee0
.
Packit 3feee0
.SH "SYNOPSIS"
Packit 3feee0
.B #include <selinux/selinux.h>
Packit 3feee0
.sp
Packit 3feee0
.BI "const char *security_class_to_string(security_class_t " tclass ");"
Packit 3feee0
.sp
Packit 3feee0
.BI "const char *security_av_perm_to_string(security_class_t " tclass ", access_vector_t " av ");"
Packit 3feee0
.sp
Packit 3feee0
.BI "int security_av_string(security_class_t " tclass ", access_vector_t " av ", char **" result ");"
Packit 3feee0
.sp
Packit 3feee0
.BI "security_class_t string_to_security_class(const char *" name ");"
Packit 3feee0
.sp
Packit 3feee0
.BI "security_class_t mode_to_security_class(mode_t " mode ");"
Packit 3feee0
.sp
Packit 3feee0
.BI "access_vector_t string_to_av_perm(security_class_t " tclass ", const char *" name ");"
Packit 3feee0
.sp
Packit 3feee0
.BI "void print_access_vector(security_class_t " tclass ", access_vector_t " av ");"
Packit 3feee0
.
Packit 3feee0
.SH "DESCRIPTION"
Packit 3feee0
.BR security_class_to_string ()
Packit 3feee0
returns a string name for class
Packit 3feee0
.IR tclass ,
Packit 3feee0
or NULL if the class is invalid.  The returned string must not be modified or freed.
Packit 3feee0
Packit 3feee0
.BR security_av_perm_to_string ()
Packit 3feee0
returns a string name for the access vector bit
Packit 3feee0
.I av
Packit 3feee0
of class
Packit 3feee0
.IR tclass ,
Packit 3feee0
or NULL if either argument is invalid.  The returned string must not be modified or freed.
Packit 3feee0
Packit 3feee0
.BR security_av_string ()
Packit 3feee0
computes a full access vector string representation using
Packit 3feee0
.I tclass
Packit 3feee0
and
Packit 3feee0
.IR av ,
Packit 3feee0
which may have multiple bits set.  The string is returned in the memory pointed to by
Packit 3feee0
.IR result ,
Packit 3feee0
and should be freed by the caller using
Packit 3feee0
.BR free (3).
Packit 3feee0
Packit 3feee0
.BR string_to_security_class ()
Packit 3feee0
returns the class value corresponding to the string name
Packit 3feee0
.IR name ,
Packit 3feee0
or zero if no such class exists.
Packit 3feee0
Packit 3feee0
.BR mode_to_security_class ()
Packit 3feee0
returns the class value corresponding to the specified 
Packit 3feee0
.IR mode ,
Packit 3feee0
or zero if no such class exists.
Packit 3feee0
Packit 3feee0
.BR string_to_av_perm ()
Packit 3feee0
returns the access vector bit corresponding to the string name
Packit 3feee0
.I name
Packit 3feee0
and security class
Packit 3feee0
.IR tclass ,
Packit 3feee0
or zero if no such value exists.
Packit 3feee0
Packit 3feee0
.BR print_access_vector ()
Packit 3feee0
displays an access vector in human-readable form on the standard output
Packit 3feee0
stream.
Packit 3feee0
.
Packit 3feee0
.SH "RETURN VALUE"
Packit 3feee0
.BR security_av_string ()
Packit 3feee0
returns zero on success or \-1 on error with
Packit 3feee0
.I errno
Packit 3feee0
set appropriately.
Packit 3feee0
.BR print_access_vector ()
Packit 3feee0
does not return a value. All other functions return zero or NULL on error.
Packit 3feee0
.
Packit 3feee0
.SH "ERRORS"
Packit 3feee0
.TP
Packit 3feee0
.B EINVAL
Packit 3feee0
A class or access vector argument is not recognized by the currently loaded policy.
Packit 3feee0
Packit 3feee0
.TP
Packit 3feee0
.B ENOMEM
Packit 3feee0
An attempt to allocate memory failed.
Packit 3feee0
.
Packit 3feee0
.SH "AUTHOR"
Packit 3feee0
Eamon Walsh <ewalsh@tycho.nsa.gov>
Packit 3feee0
.
Packit 3feee0
.SH "SEE ALSO"
Packit 3feee0
.BR selinux (8),
Packit 3feee0
.BR getcon (3),
Packit 3feee0
.BR getfilecon (3)
Packit 3feee0
.BR stat (3)