selabel_lookup_raw (3) - Linux Man Pages
selabel_lookup_raw: obtain SELinux security context from a string label
selabel_lookup - obtain SELinux security context from a string label
int selabel_lookup(struct selabel_handle *hnd,
const char *key, int type);
DESCRIPTIONselabel_lookup() performs a lookup operation on the handle hnd, returning the result in the memory pointed to by context, which must be freed by the caller using freecon(3). The key and type parameters are the inputs to the lookup operation and are interpreted according to the specific backend that handle is open on.
RETURN VALUEOn success, zero is returned. On error, -1 is returned and errno is set appropriately.
- No context corresponding to the input key and type was found.
- The key and/or type inputs are invalid, or the context being returned failed validation.
- An attempt to allocate memory failed.