semanage_modify(3)
β¨ semanage_modify(3) β¨
okay bestie, welcome to the libsemanage API docs π this is semanage_modify from section 3 of the manual, and she is lowkey the glow-up function of the SELinux management world. buckle up π
πΈ NAME πΈ
semanage_modify β SELinux Management API π
π¦ SYNOPSIS π¦
so the tea is: the following modify function is supported for any semanage record. literally any of them. just swap out the function and object name to match whatever record you're working with, iykyk π
extern int MODIFY_FUNCTION (
semanage_handle_t *handle,
const semanage_OBJECT_key_t *key,
const semanage_OBJECT_t *data);
π DESCRIPTION π
π Behavior
here's the vibe: if a matching key is found in the local store, the object you're handing over will replace the one that's currently there. no matching key? then it just gets added to the store instead. either way she's in π«Ά
when semanage_commit(3) gets invoked, the changes get permanently written into the local store, and then loaded into policy. periodt.
the validity of the object being added? checked at commit time, not before. adding new objects with respect to policy is allowed β except in the case of booleans. if you try to add new booleans with respect to policy, it will fail at commit time. that's not a vibe. π
π Parameters
- the handle is used to track persistent state across semanage calls, and for error reporting π
- the key identifies the data object, which will be written into the store ποΈ
- the key and the data are properties of the caller, and are not stored or modified internally β she does not touch them, no cap π«
β Requirements
this function requires a semanage connection to be established (peep semanage_connect(3)), and it must be executed in a transaction (peep semanage_begin_transaction(3)). no connection, no transaction, no service π
π RETURN VALUE π
if it fails, -1 is returned, and the semanage error callback gets invoked, describing the error (she will tell you what went wrong, fr fr π). otherwise, 0 is returned. slay.
π₯ SEE ALSO π₯
semanage_handle_create(3)semanage_begin_transaction(3)semanage_connect(3)semanage_commit(3)
and that's the whole page, bestie β¨ this icon was brought to you by ivg2@cornell.edu, dated 16 March 2006 β yes she's an elder but she still ate π ππ¦πΈπ
π¦ 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