man-pages/man3/security_class_to_string.3.html
2021-03-31 01:06:50 +01:00

165 lines
4.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of security_class_to_string</TITLE>
</HEAD><BODY>
<H1>security_class_to_string</H1>
Section: SELinux API documentation (3)<BR>Updated: 30 Mar 2007<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
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
between SELinux class and permission values and string names.
print_access_vector - display an access vector in human-readable form.
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>#include &lt;<A HREF="file:///usr/include/selinux/selinux.h">selinux/selinux.h</A>&gt;</B>
<P>
<B>const char *security_class_to_string(security_class_t </B><I>tclass</I><B>);</B>
<P>
<B>const char *security_av_perm_to_string(security_class_t </B><I>tclass</I><B>, access_vector_t </B><I>av</I><B>);</B>
<P>
<B>int security_av_string(security_class_t </B><I>tclass</I><B>, access_vector_t </B><I>av</I><B>, char **</B><I>result</I><B>);</B>
<P>
<B>security_class_t string_to_security_class(const char *</B><I>name</I><B>);</B>
<P>
<B>security_class_t mode_to_security_class(mode_t </B><I>mode</I><B>);</B>
<P>
<B>access_vector_t string_to_av_perm(security_class_t </B><I>tclass</I><B>, const char *</B><I>name</I><B>);</B>
<P>
<B>void print_access_vector(security_class_t </B><I>tclass</I><B>, access_vector_t </B><I>av</I><B>);</B>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>security_class_to_string</B>()
returns a string name for class
<I>tclass</I>,
or NULL if the class is invalid. The returned string must not be modified or freed.
<P>
<B>security_av_perm_to_string</B>()
returns a string name for the access vector bit
<I>av</I>
of class
<I>tclass</I>,
or NULL if either argument is invalid. The returned string must not be modified or freed.
<P>
<B>security_av_string</B>()
computes a full access vector string representation using
<I>tclass</I>
and
<I>av</I>,
which may have multiple bits set. The string is returned in the memory pointed to by
<I>result</I>,
and should be freed by the caller using
<B><A HREF="/cgi-bin/man/man2html?3+free">free</A></B>(3).
<P>
<B>string_to_security_class</B>()
returns the class value corresponding to the string name
<I>name</I>,
or zero if no such class exists.
<P>
<B>mode_to_security_class</B>()
returns the class value corresponding to the specified
<I>mode</I>,
or zero if no such class exists.
<P>
<B>string_to_av_perm</B>()
returns the access vector bit corresponding to the string name
<I>name</I>
and security class
<I>tclass</I>,
or zero if no such value exists.
<P>
<B>print_access_vector</B>()
displays an access vector in human-readable form on the standard output
stream.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
<B>security_av_string</B>()
returns zero on success or -1 on error with
<I>errno</I>
set appropriately.
<B>print_access_vector</B>()
does not return a value. All other functions return zero or NULL on error.
<A NAME="lbAF">&nbsp;</A>
<H2>ERRORS</H2>
<DL COMPACT>
<DT id="1"><B>EINVAL</B>
<DD>
A class or access vector argument is not recognized by the currently loaded policy.
<P>
<DT id="2"><B>ENOMEM</B>
<DD>
An attempt to allocate memory failed.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>AUTHOR</H2>
Eamon Walsh &lt;<A HREF="mailto:ewalsh@tycho.nsa.gov">ewalsh@tycho.nsa.gov</A>&gt;
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?8+selinux">selinux</A></B>(8),
<B><A HREF="/cgi-bin/man/man2html?3+getcon">getcon</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+getfilecon">getfilecon</A></B>(3)
<B><A HREF="/cgi-bin/man/man2html?3+stat">stat</A></B>(3)
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="3"><A HREF="#lbAB">NAME</A><DD>
<DT id="4"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="5"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="6"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="7"><A HREF="#lbAF">ERRORS</A><DD>
<DT id="8"><A HREF="#lbAG">AUTHOR</A><DD>
<DT id="9"><A HREF="#lbAH">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:56 GMT, March 31, 2021
</BODY>
</HTML>