is_context_customizable(3)

πŸ“¦
version 3.11 Β· 2 versions
, in alpine 3.24, centos-stream 10, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ is_context_customizable ✨

okay bestie, welcome to the SELinux API docs, and today's main character is is_context_customizable(3) β€” she's a lil function that checks whether a SELinux context type is customizable by the administrator πŸŽ€


🌸 NAME 🌸

is_context_customizable β€” check whether SELinux context type is customizable by the administrator


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <selinux/selinux.h>

int is_context_customizable(const char *scon);

πŸ’– DESCRIPTION πŸ’–

so basically, this function checks whether the type of scon lives inside the /etc/selinux/{SELINUXTYPE}/context/customizable_types file. that's it, that's the whole vibe check πŸ’…

and like, what even is a customizable type? a customizable type is a file context type that administrators set on files β€” usually so that certain domains can share the file content 🫢 lowkey iconic behaviour.

also important: restorecon and setfiles, by default, leave these context in place. so if you were wondering why your custom label didn't get nuked, it's giving by design, bestie 😌


πŸ‘‘ RETURN VALUE πŸ‘‘

  • returns 1 if security context is customizable ✨
  • returns 0 if it is not πŸ™ˆ
  • returns -1 on error 😭

πŸŽ€ FILE πŸŽ€

/etc/selinux/{SELINUXTYPE}/context/customizable_types


🌈 SEE ALSO 🌈


ngl, if you're messing with SELinux contexts, go read selinux(8) too β€” she's the mother of the whole situation πŸ’œ

and that's the page fr fr 🌸 written by dwalsh@redhat.com, dated 10 January 2005, and it's part of the SELinux API documentation β€” mwah, slay, periodt πŸ’…πŸ’–