semanage_exists(3)
β¨ semanage_exists(3) β Libsemanage API documentation β¨
okay bestie, welcome to the libsemanage corner of the SELinux universe π this is the semanage_exists page and it's literally just the "does this thing exist or not" queen of the API. she's simple, she's iconic, she ate.
πΈ NAME πΈ
semanage_exists β SELinux Management API π«Ά
β¨ SYNOPSIS β¨
so here's the vibe: the following exists function is supported for any semanage record. just swap in the function and object name you actually need, no cap π§
extern int EXISTS_FUNCTION (
semanage_handle_t *handle,
const semanage_OBJECT_key_t *key,
semanage_OBJECT_t **response);
like, replace the function and object name as necessary and you're good to go π
π¦ DESCRIPTION π¦
π« Behavior:
the exists function returns 0 if a matching key is not found, and 1 otherwise. that's it, that's the whole personality π
π« Parameters:
- the
handleis used to track persistent state across semanage calls, and for error reporting. she's the main character keeping everything together π - the
keyidentifies the object being checked π - the result of the test will be stored in the address pointed by
response㪠- the
keyis a property of the caller, and will not be stored or modified internally. so don't stress, she's not keeping your key, she's just borrowing it for the vibe check π
π« Requirements:
this function requires a semanage connection to be established β see semanage_connect(3) β so pls go make that connection first, bestie, she can't work with nothing π
π RETURN VALUE π
in case of failure, -1 is returned, and the semanage error callback is invoked, describing the error π so yeah, that's how you know it went sideways.
otherwise a non-negative integer is returned β and that's a commit number β¨. the same number will be returned by all other read calls to the semanage database until the next commit. so it stays consistent, periodt π
π SEE ALSO π
semanage_handle_create(3)semanage_connect(3)
okay that's the whole page, you're so welcome π«Ά this one's courtesy of ivg2@cornell.edu, dated 16 March 2006, and it's the semanage_exists(3) page from the Libsemanage API documentation set β mwah, go forth and check if things exist, bestie πβ¨πΈ
π¦ 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