selinux_boolean_sub(3)

πŸ’– selinux_boolean_sub β€” it's in the SELinux API documentation, bestie πŸ’–

okay so real talk: selinux_boolean_sub is a lil function that hunts down the translated name for a boolean_name record. that's it. that's the whole job. she's a lookup girlie and she's iconic for it ✨


🌸 SYNOPSIS 🌸

#include <selinux/selinux.h>

char *selinux_boolean_sub(const char *boolean_name);

πŸ¦‹ DESCRIPTION πŸ¦‹

so selinux_boolean_sub() goes digging through the file at /etc/selinux/{POLICYTYPE}/booleans.subs_dist, looking for a boolean_name record that matches yours. lowkey a whole scavenger hunt πŸ’…

if that record exists, she hands you back the boolean substitution name. periodt.

if it does not exist? no stress, no drama β€” selinux_boolean_sub() just returns your original boolean_name to you, unchanged. she's not gonna leave you hanging 🫢


✨ RETURN VALUE ✨

on success, selinux_boolean_sub() returns either the boolean_name or the substituted name. either way you're eating good πŸ“

⚠️ important bestie: the returned value must be freed with free(3). don't forget, or that's a leak and we don't do leaks in this house πŸ’€

and if something goes wrong? selinux_boolean_sub() returns NULL on error. not great, not terrible, just NULL 😭


πŸ‘‘ SEE ALSO πŸ‘‘


mwah πŸ’œ that's the whole page. written by dwalsh@redhat.com, dated 11 June 2012, and it lives in selinux_boolean_sub(3). slay, go free your memory, ily bye πŸŽ€βœ¨

πŸ“¦ where this page comes from