semanage_list(3)
π semanage_list β SELinux Lists Management API π
okay bestie, welcome to semanage_list(3) from the SELinux management API docs π«Ά this one's a lil function family, not a single function, so buckle up.
β¨ SYNOPSIS β¨
so here's the thing: this one list function works for any SELinux management record. you just swap in whatever function name and object name you actually need β LIST_FUNCTION and OBJECT are literally placeholders, like a lil outfit you dress up per record π
extern int LIST_FUNCTION (
semanage_handle_t *handle,
semanage_OBJECT_t ***objects,
unsigned int* count);
πΈ DESCRIPTION πΈ
π Behavior
the list function hands you back an array containing every single object chillin' in the location you picked. all of them. the whole squad. no cap. β¨
π Parameters
handleβ this is your state-tracking bestie. it keeps persistent state alive across all yoursemanagecalls and it's also where error reporting lives. lowkey the most important girlypop in the room.objectsβ the function is gonna allocate the array of objects and fill it up, then stash it at the location thatobjectspoints to. so you pass the address-of-the-pointer, it does the rest πͺcountβ it writes the number of objects right there at the locationcountpoints to. so you know exactly how many you got.
π¨ IMPORTANT BESTIE π¨ the array and every single object inside it become the property of the caller. that's you. you own them now. each object must be freed with semanage_OBJECT_free. don't ghost them, free them π
π¦ Requirements
this function needs a semanage connection to already be established β go peek at semanage_connect(3) if you haven't set that up yet. no connection, no vibes, no list. periodt.
β RETURN VALUE β
if it flops, you get -1 back, and the semanage error callback gets invoked to tell you what went wrong. read it, it's giving helpful.
otherwise you get a non-negative integer β that's a commit number π and here's the cute part: every other semanage object read call will return that exact same number until the next commit happens. consistent queen behavior, we love to see it π
π SEE ALSO π
semanage_handle_create(3)semanage_connect(3)
that's the whole page bestie, you ate it π
this lil gem came from ivg2@cornell.edu and it's dated 16 March 2006 β yes it's vintage, yes it still slays πβ¨π¦
π¦ 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