Debian Codegraph @

libselinux/man/man3/selabel_digest.3

raw
1 .TH "selabel_digest" "3" "16 Sept 2015" "" "SELinux API documentation"
2 .SH "NAME"
3 selabel_digest \- Return digest of specfiles and list of files used
4 .
5 .SH "SYNOPSIS"
6 .B #include <selinux/selinux.h>
7 .br
8 .B #include <selinux/label.h>
9 .sp
10 .BI "int selabel_digest(struct selabel_handle *" hnd ,
11 .in +\w'int selabel_digest('u
12 .BI "unsigned char **" digest ,
13 .BI "size_t *" digest_len ,
14 .br
15 .BI "char ***" specfiles,
16 .BI "size_t *" num_specfiles ");"
17 .in
18 .
19 .SH "DESCRIPTION"
20 .BR selabel_digest ()
21 performs an operation on the handle
22 .IR hnd ,
23 returning the results of the SHA1 digest pointed to by
24 .IR digest ,
25 whose length will be
26 .IR digest_len .
27 The list of specfiles used in the SHA1 digest calculation is returned in
28 .I specfiles
29 with the number of entries in
30 .IR num_specfiles .
31 .sp
32 To enable
33 .BR selabel_digest ()
34 to return this information the
35 .B SELABEL_OPT_DIGEST
36 option must be enable in
37 .BR selabel_open (3).
38 .sp
39 The result of
40 .BR selabel_digest ()
41 must not be used after
42 .BR selabel_close (3).
43 .
44 .SH "RETURN VALUE"
45 On success, zero is returned. On error, \-1 is returned and
46 .I errno
47 is set appropriately.
48 .
49 .SH "ERRORS"
50 .TP
51 .B EINVAL
52 No digest available (returned if
53 .B SELABEL_OPT_DIGEST
54 option not enabled).
55 .TP
56 .B ENOMEM
57 An attempt to allocate memory failed.
58 .
59 .SH "SEE ALSO"
60 .BR selabel_open (3),
61 .BR selinux (8)