| 1 |
.TH semanage_query 3 "15 March 2006" "[email protected]" "Libsemanage API documentation" |
| 2 |
|
| 3 |
.SH "NAME" |
| 4 |
semanage_query \- SELinux Management API |
| 5 |
|
| 6 |
.SH "SYNOPSIS" |
| 7 |
The following query function is supported for any semanage record. |
| 8 |
.br |
| 9 |
Replace the function and object name as necessary. |
| 10 |
|
| 11 |
.B extern int QUERY_FUNCTION ( |
| 12 |
.br |
| 13 |
.BI " semanage_handle_t *" handle "," |
| 14 |
.br |
| 15 |
.BI " const semanage_OBJECT_key_t *" key "," |
| 16 |
.br |
| 17 |
.BI " semanage_OBJECT_t **" response ");" |
| 18 |
|
| 19 |
.SH "DESCRIPTION" |
| 20 |
.TP |
| 21 |
.B Behavior: |
| 22 |
The query function will fail if a matching key is not found. Otherwise, the corresponding object is returned. |
| 23 |
|
| 24 |
.TP |
| 25 |
.B Parameters: |
| 26 |
The |
| 27 |
.I handle |
| 28 |
is used to track persistent state across semanage calls, and for error reporting. The |
| 29 |
.I key |
| 30 |
identifies the object being queried, which will be stored in the address pointed by |
| 31 |
.I response |
| 32 |
The key is a property of the caller, and will not be stored or modified internally. The object returned becomes a property of the caller, and must be freed with |
| 33 |
.B semanage_OBJECT_free. |
| 34 |
|
| 35 |
.TP |
| 36 |
.B Requirements: |
| 37 |
This function requires an semanage connection to be established (see |
| 38 |
.BR semanage_connect "(3)" |
| 39 |
) |
| 40 |
|
| 41 |
.SH "RETURN VALUE" |
| 42 |
In case of failure, \-1 is returned, and the semanage error callback is invoked, describing the error. |
| 43 |
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. |
| 44 |
|
| 45 |
.SH "SEE ALSO" |
| 46 |
.BR semanage_handle_create "(3), " semanage_connect "(3), " |