SELABEL_GET_DIGESTS_ALL_PARTIAL_MATCHES(3)

πŸ’– selabel_get_digests_all_partial_matches β€” Library Functions Manual πŸ’–

okay bestie, gather round, because we're talking about selabel_get_digests_all_partial_matches(3) and honestly? it's giving niche but iconic. ✨


🌸 NAME 🌸

selabel_get_digests_all_partial_matches β€” retrieve the partial matches digest and the xattr digest that applies to the supplied path β€” Only supported on file backend.


πŸŽ€ SYNOPSIS πŸŽ€

#include <stdbool.h>
#include <selinux/selinux.h>
#include <selinux/label.h>

bool selabel_get_digests_all_partial_matches(
                                        struct selabel_handle *hnd,
                                        const char *key,
                                        uint8_t **calculated_digest,
                                        uint8_t **xattr_digest,
                                        size_t *digest_len);

πŸ’… DESCRIPTION πŸ’…

so selabel_get_digests_all_partial_matches() goes and gets two things for you off the handle hnd: the file_contexts partial matches digest, and the xattr digest that applies to the path you hand it. two digests, one function, we love a two-for-one 🫢

  • key β€” this is the path whose digests you want. drop the path here, that's it.
  • calculated_digest β€” a pointer to the key calculated file_contexts digest of all applicable partial matches, or NULL if none exist. and bestie, listen: the caller must free(3) the buffer. no leaks in this house. πŸ’€
  • xattr_digest β€” a pointer to the key xattr(7) stored digest, or NULL if it does not exist. same rules, same energy: the caller must free(3) the buffer. 🧚
  • digest_len β€” the length of the digests, which will always be returned (yes, even if both of them are NULL, she still shows up ✨). also, quick note: if both digests are returned, they will always be the same length. twin vibes, no cap.

πŸ‘‘ RETURN VALUE πŸ‘‘

TRUE if the digests match, or FALSE if they do not β€” or if either or both are missing. it's a yes/no situation and she's very clear about it. periodt. πŸ’–


🌈 SEE ALSO 🌈


and that's the whole page, bestie!! brought to you by the SELinux API documentation, dated 14 April 2019 β€” thanks for coming to my ted talk, now go free those buffers πŸ’…βœ¨

πŸ“¦ where this page comes from