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

123 lines
2.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of selabel_digest</TITLE>
</HEAD><BODY>
<H1>selabel_digest</H1>
Section: SELinux API documentation (3)<BR>Updated: 16 Sept 2015<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>
selabel_digest - Return digest of specfiles and list of files used
<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/label.h">selinux/label.h</A>&gt;</B>
<P>
<B>int selabel_digest(struct selabel_handle *</B><I>hnd</I><B>,</B>
<B>unsigned char **</B><I>digest</I><B>,</B>
<B>size_t *</B><I>digest_len</I><B>,</B>
<BR>
<B>char ***</B><I>specfiles,</I>
<B>size_t *</B><I>num_specfiles</I><B>);</B>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>selabel_digest</B>()
performs an operation on the handle
<I>hnd</I>,
returning the results of the SHA1 digest pointed to by
<I>digest</I>,
whose length will be
<I>digest_len</I>.
The list of specfiles used in the SHA1 digest calculation is returned in
<I>specfiles</I>
with the number of entries in
<I>num_specfiles</I>.
<P>
To enable
<B>selabel_digest</B>()
to return this information the
<B>SELABEL_OPT_DIGEST</B>
option must be enable in
<B><A HREF="/cgi-bin/man/man2html?3+selabel_open">selabel_open</A></B>(3).
<P>
The result of
<B>selabel_digest</B>()
must not be used after
<B><A HREF="/cgi-bin/man/man2html?3+selabel_close">selabel_close</A></B>(3).
<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>
No digest available (returned if
<B>SELABEL_OPT_DIGEST</B>
option not enabled).
<DT id="2"><B>ENOMEM</B>
<DD>
An attempt to allocate memory failed.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?3+selabel_open">selabel_open</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">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>