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

121 lines
3.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of avc_compute_create</TITLE>
</HEAD><BODY>
<H1>avc_compute_create</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>
avc_compute_create, avc_compute_member - obtain SELinux label for new object
<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>
<BR>
<B>#include &lt;<A HREF="file:///usr/include/selinux/avc.h">selinux/avc.h</A>&gt;</B>
<P>
<B>int avc_compute_create(security_id_t </B><I>ssid</I><B>, security_id_t </B><I>tsid</I><B>,</B>
<B>security_class_t </B><I>tclass</I><B>, security_id_t *</B><I>newsid</I><B>);</B>
<P>
<B>int avc_compute_member(security_id_t </B><I>ssid</I><B>, security_id_t </B><I>tsid</I><B>,</B>
<B>security_class_t </B><I>tclass</I><B>, security_id_t *</B><I>newsid</I><B>);</B>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>avc_compute_create</B>()
is used to compute a SID to use for labeling a new object in a particular class based on a SID pair. This call is identical to
<B>security_compute_create</B>(),
but does not require converting from userspace SID's to contexts and back again.
<P>
<B>avc_compute_member</B>()
is used to compute a SID to use for labeling a polyinstantiated object instance of a particular class based on a SID pair. This call is identical to
<B>security_compute_member</B>(),
but does not require converting from userspace SID's to contexts and back again.
<P>
These functions
return a SID for the computed context in the memory referenced by
<I>sid</I>.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
On success, zero is returned. On error, -1 is returned and
<I>errno</I>
is set appropriately.
<A NAME="lbAF">&nbsp;</A>
<H2>ERRORS</H2>
<DL COMPACT>
<DT id="1"><B>EINVAL</B>
<DD>
The
<I>tclass</I>
and/or the security contexts referenced by
<I>ssid</I>
and
<I>tsid</I>
are not recognized by the currently loaded policy.
<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?3+avc_init">avc_init</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+avc_context_to_sid">avc_context_to_sid</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+security_compute_create">security_compute_create</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?8+selinux">selinux</A></B>(8)
<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:36 GMT, March 31, 2021
</BODY>
</HTML>