semanage_seuser(3)
π semanage_seuser β the manual page, but make it cute π
okay bestie, pull up a chair πͺ because we're talking about semanage_seuser(3), aka the Linux UID to SELinux User Management API from the Libsemanage API documentation. yes it's a mouthful. yes it's iconic. let's get into it π
β¨ NAME β¨
semanage_seuser β the Linux UID to SELinux User Management API π«Ά
β¨ SYNOPSIS β¨
#include <semanage/seuser_record.h>
#include <semanage/seusers_policy.h>
#include <semanage/seusers_local.h>
so this object is holding all the properties that go with a Unix user. and here's the tea: normally a whole bunch of Unix users get mapped to the same SELinux user. that's just how it is, no cap. if you want the big-picture overview of the SELinux user API, go read semanage_user(3) π
and if you wanna know the details on any one specific function? each one has its own manual page, so go look it up, iykyk β¨
πΈ Record API Overview πΈ
these are the record girlies β creating, freeing, keying, cloning, comparing. the whole friend group π
semanage_seuser_create(3)β creates a seuser β¨semanage_seuser_free(3)β releases the resources for this seuser πsemanage_seuser_key_create(3)β creates a key, which you can use to identify a seuser πsemanage_seuser_key_free(3)β releases the resources for this seuser key π«Άsemanage_seuser_key_extract(3)β creates a key that matches this seuser πsemanage_seuser_clone(3)β creates an identical seuser (it's a deep-copy clone, so like, a real twin, not a shallow one π)semanage_seuser_compare(3)β compares this seuser to the key you provided π¦semanage_seuser_compare2(3)β compares this seuser to another seuser π―
π Properties API Overview π
get / set energy. names, senames, MLS ranges. the glow-up section β¨
semanage_seuser_get_name(3)β returns the name of this seuser πsemanage_user_set_name(3)β sets the name of this seuser ποΈsemanage_seuser_get_sename(3)β returns the name of the (SELinux) user that's mapped to this seuser πsemanage_user_set_sename(3)β sets the name of the (SELinux) user that's mapped to this seuser ποΈsemanage_user_get_mlsrange(3)β returns a the range of valid MLS sensitivities and categories for this user πsemanage_user_set_mlsrange(3)β sets the range of valid MLS sensitivities and categories for this user π
π Record Store API Overview π
the local store vs the persistent policy. two worlds, one API. main character energy fr fr π
semanage_seuser_modify_local(3)β adds or updates a seuser in the local store βοΈsemanage_seuser_del_local(3)β deletes a seuser from the local store ποΈsemanage_seuser_exists(3)β checks if a seuser is defined in the persistent policy πsemanage_seuser_exists_local(3)β checks if a seuser is defined in the local store πsemanage_seuser_query(3)β queries a seuser in the persistent policy π¬semanage_seuser_query_local(3)β queries a seuser in the local store π¬semanage_seuser_count(3)β counts the number of seusers defined in the persistent policy π’semanage_seuser_count_local(3)β counts the number of seusers defined in the local store π’semanage_seuser_iterate(3)β executes a callback for each seuser in the persistent policy πsemanage_seuser_iterate_local(3)β executes a callback for each seuser in the local store πsemanage_seuser_list(3)β returns an array containing all seusers in the persistent policy πsemanage_seuser_list_local(3)β returns an array containing all seusers in the local store π
lowkey obsessed with how consistent this API is. every single function has a local twin. sibling energy π―π
and that's the whole page, bestie!! πβ¨ this absolute banger of a manpage was brought to you by ivg2@cornell.edu, dated 16 March 2006 π β shoutout to the Libsemanage API documentation for the lore, and to you for reading all the way to the end. mwah ππ«Ά
π¦ where this page comes from
- centos-stream 10: libsemanage-devel 3.11-3.el10 Β· LGPL-2.1-or-later
- debian trixie: libsemanage-dev 3.8.1-1 Β· LGPL-2.1-or-later
- fedora 43: libsemanage-devel 3.9-4.fc43 Β· LGPL-2.1-or-later
- fedora 43: libsemanage-devel 3.9-4.fc43 Β· LGPL-2.1-or-later
- fedora 44: libsemanage-devel 3.10-1.fc44 Β· LGPL-2.1-or-later
- fedora 44: libsemanage-devel 3.10-1.fc44 Β· LGPL-2.1-or-later
- fedora 44: libsemanage-devel 3.11-1.fc44 Β· LGPL-2.1-or-later
- fedora 44: libsemanage-devel 3.11-1.fc44 Β· LGPL-2.1-or-later
- nixos 26.05: libsemanage 3.10
- nixpkgs unstable: libsemanage 3.11
- opensuse-leap 16.0: libsemanage-devel 3.8.1-160000.3.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libsemanage-devel 3.8.1-160000.3.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libsemanage-devel 3.8.1-160000.3.1 Β· LGPL-2.1-or-later
- opensuse-leap 16.0: libsemanage-devel 3.8.1-160000.3.1 Β· LGPL-2.1-or-later
- ubuntu questing: libsemanage-dev 3.8.1-1
- ubuntu resolute: libsemanage-dev 3.9-1build1 Β· LGPL-2.1-or-later
- ubuntu stonking: libsemanage-dev 3.11-1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms