semanage_fcontext(3)

๐Ÿ“ฆ
version 3.11 ยท 2 versions
, in centos-stream 10, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

โœจ NAME โœจ

semanage_fcontext โ€” SELinux File Context Management API ๐Ÿ’–


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

#include <semanage/fcontext_record.h>
#include <semanage/fcontexts_policy.h>
#include <semanage/fcontexts_local.h>

okay so real talk: this object is the lil container that holds all the properties chillin' with a SELinux file context specification ๐Ÿซถ

and if you wanna get the tea on any one of these functions specifically, bestie, each one has its own manual page โ€” go read that one, it's giving detail ๐Ÿ’…


๐ŸŒธ Record API Overview ๐ŸŒธ

  • semanage_fcontext_create(3) โ€” manifest a whole new file context spec into existence โœจ
  • semanage_fcontext_free(3) โ€” let this file context spec go, release all its resources, it's done, goodbye ๐ŸŽ€
  • semanage_fcontext_key_create(3) โ€” make a key, and that key is what you use to identify a file context spec ๐Ÿ”‘
  • semanage_fcontext_key_free(3) โ€” release the resources for this file context spec key, free it, set it free ๐Ÿฆ‹
  • semanage_fcontext_key_extract(3) โ€” pull a key out that matches this file context spec ๐Ÿ’ซ
  • semanage_fcontext_clone(3) โ€” make an identical file context spec โ€” a deep-copy clone, twin behavior, no cap ๐Ÿ‘ฏ
  • semanage_fcontext_compare(3) โ€” compare this file context spec against the key you handed over ๐Ÿง
  • semanage_fcontext_compare2(3) โ€” compare this file context spec to another one, one-on-one, main character vs main character โš”๏ธ

๐ŸŽ€ Properties API Overview ๐ŸŽ€

  • semanage_fcontext_get_expr(3) โ€” hand you back the regular expression for this file context spec ๐Ÿ“
  • semanage_fcontext_set_expr(3) โ€” set the regular expression for this file context spec โœ๏ธ
  • semanage_fcontext_get_type(3) โ€” hand you back the file type for this file context spec ๐Ÿท๏ธ
  • semanage_fcontext_get_type_str(3) โ€” hand you back a string representation of this file context spec's type, like the type but dressed up as text ๐Ÿ’ฌ
  • semanage_fcontext_set_type(3) โ€” set the file type for this file context spec ๐Ÿ–Š๏ธ
  • semanage_fcontext_get_con(3) โ€” hand you back the SELinux context for this file context spec ๐Ÿ’œ
  • semanage_fcontext_set_expr(3) โ€” set the SELinux context for this file context spec ๐Ÿ‘‘
not me noticing semanage_fcontext_set_expr(3) shows up twice in this list ๐Ÿ™ˆ the second one is listed as setting the SELinux context โ€” that's literally what the page says, so I'm passing it to you exactly as-is, bestie. no edits, no guessing, periodt.

๐ŸŒˆ Record Store API Overview ๐ŸŒˆ


that's the whole page, bestie, you ate it ๐Ÿ’…โœจ

this lil love letter to SELinux was brought to you by ivg2@cornell.edu, dated 16 March 2006, and it lives under the name semanage_fcontext(3) ๐ŸŽ€ go forth and manage those file contexts, you've got this ๐Ÿซถ๐Ÿ’–