semanage_iterate(3)
β¨ semanage_iterate(3) β¨
okay bestie, so this is a page from the Libsemanage API documentation, section 3 of the manual, and it's all about semanage_iterate. SELinux management, but make it a group chat π«Ά
π NAME π
semanage_iterate β SELinux Management API
πΈ SYNOPSIS πΈ
so here's the vibe: the following iterate function is supported for any semanage record. you just replace the function and object name as necessary, like a little mad-libs situation π
extern int ITERATE_FUNCTION (
semanage_handle_t *handle,
int (*handler) (
const semanage_OBJECT_t *object,
void *varg),
void *handler_arg);
π¦ DESCRIPTION π¦
β¨ Behavior β¨
The iterate function will execute the specified handler over all objects in the selected location. An arbitrary argument can be passed into the handler function along with each object. cute, right?
π¨ okay important: the object passed in is property of the libsemanage library, and may not be modified or preserved β use semanage_OBJECT_clone if that is necessary. do not touch. do not keep. no cap.
The handler code may not invoke any semanage write requests for the same object type (i.e. modifying the underlying store is not allowed). The iterate function is reentrant only while inside a transaction (see semanage_begin_transaction). It is not safe to execute other semanage read or write requests within iterate if not inside a transaction. π
The handler may return:
-1β to signal error exit0β to signal continue1β to signal successful exit early
(the iterate function will stop accordingly.)
π Parameters π
- The handle is used to track persistent state across semanage calls, and for error reporting.
- The handler is the function to execute, with handler_arg as its second parameter, and each object as its first parameter.
π Requirements π
This function requires an semanage connection to be established (see semanage_connect(3) )
π RETURN VALUE π
In case of failure, -1 is returned, and the semanage error callback is invoked, describing the error. Otherwise a non-negative integer is returned (a commit number). The same number will be returned by all other semanage object read calls until the next commit. it's giving consistent. periodt.
β SEE ALSO β
semanage_handle_create(3)semanage_connect(3)
and that's the whole page, bestie! this one was written by ivg2@cornell.edu and dated 15 March 2006 β absolute icon behavior, we love a classic π go iterate responsibly, 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