semanage_del(3)
π semanage_del(3) β the Libsemanage API glow-up
okay bestie, gather round, because we're about to talk about semanage_del, aka the SELinux Management API function that says "girl, bye" to a record in your local store. this is from the Libsemanage API documentation and honestly? it's giving minimal but mighty. β¨
πΈ SYNOPSIS πΈ
so the tea is: this delete function works for any semanage record. you just swap in whatever function and object name you actually need β mix and match, it's your world. π¦
extern int DELETE_FUNCTION (
semanage_handle_t *handle,
const semanage_OBJECT_key_t *key);
like, DELETE_FUNCTION and OBJECT are placeholders, bestie. don't come for me, just replace them as necessary. periodt. π
π DESCRIPTION π
β¨ Behavior β¨
the delete function removes the object that matches the key you hand it, straight out of the local store. no match found? no problem, nothing happens, no action is taken, we simply move on with our lives. π§
the changes don't actually stick around until you invoke semanage_commit(3) β that's when they become permanent. and lowkey important: additional checks may be performed at that time to make sure the system is left in a valid state. so the commit is the vibe check, basically. π₯
π«Ά Parameters π«Ά
- the handle β this is what tracks persistent state across all your semanage calls, and it's also where error reporting happens. it's the main character holding the group chat together, ngl.
- the key β this identifies the data object that's getting deleted from the local store. important detail: the key is a property of the caller, and it will not be stored or modified internally. it does not get kept, it does not get touched. respect its boundaries. π
π Requirements π
this function has needs, okay:
- it requires a semanage connection to be established β go see
semanage_connect(3). - it must be executed in a transaction β go see
semanage_begin_transaction(3).
no connection, no transaction, no delete. it's giving β¨boundariesβ¨.
β RETURN VALUE β
- if it fails,
-1is returned, and the semanage error callback gets invoked to describe the error. so you will know what went wrong, she's not gonna ghost you. π - otherwise,
0is returned. slay. π
π SEE ALSO π
semanage_handle_create(3)semanage_begin_transaction(3)semanage_connect(3)semanage_commit(3)
lowkey reminder bestie: the delete only really lands when you commit. don't forget the semanage_commit(3) or your changes are just vibes. π
written by ivg2@cornell.edu, dated 16 March 2006, from the semanage_del(3) era of the Libsemanage API docs. she's vintage, she's iconic, she's still serving. ππ
π¦ 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