logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

selabel_lookup - obtain SELinux security context from a string label

Author

       Eamon Walsh <ewalsh@tycho.nsa.gov>

Description

selabel_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.

       selabel_lookup_raw() behaves identically to selabel_lookup() but does not perform context translation.

Errors

ENOENT No context corresponding to the input key and type was found.

       EINVAL The key and/or type inputs are invalid, or the context being  returned  failed  validation,  or  a
              regular expression in the database failed to compile.

       ENOMEM An attempt to allocate memory failed.

Name

       selabel_lookup - obtain SELinux security context from a string label

Return Value

       On success, zero is returned.  On error, -1 is returned and errno is set appropriately.

See Also

selabel_open(3), selabel_stats(3), selinux_set_callback(3), selinux(8)

                                                   18 Jun 2007                                 selabel_lookup(3)

Synopsis

#include<selinux/selinux.h>#include<selinux/label.h>intselabel_lookup(structselabel_handle*hnd,char**context,constchar*key,inttype);intselabel_lookup_raw(structselabel_handle*hnd,char**context,constchar*key,inttype);

See Also