1selabel_lookup(3) SELinux API documentation selabel_lookup(3)
2
3
4
6 selabel_lookup - obtain SELinux security context from a string label.
7
9 #include <selinux/selinux.h>
10
11 #include <selinux/label.h>
12
13 int selabel_lookup(struct selabel_handle *hnd,
14 security_context_t *context,
15
16 const char *key, int type);
17
18 int selabel_lookup_raw(struct selabel_handle *hnd,
19 security_context_t *context,
20
21 const char *key, int type);
22
23
25 selabel_lookup performs a lookup operation on the handle hnd, returning
26 the result in the memory pointed to by context, which must be freed by
27 the caller using freecon(3). The key and type parameters are the
28 inputs to the lookup operation and are interpreted according to the
29 specific backend that handle is open on.
30
31 selabel_lookup_raw behaves identically to selabel_lookup but does not
32 perform context translation.
33
34
36 On success, zero is returned. On error, -1 is returned and errno is
37 set appropriately.
38
39
41 ENOENT No context corresponding to the input key and type was found.
42
43 EINVAL The key and/or type inputs are invalid, or the context being
44 returned failed validation.
45
46 ENOMEM An attempt to allocate memory failed.
47
48
50 Eamon Walsh <ewalsh@tycho.nsa.gov>
51
52
54 selabel_open(3), selabel_stats(3), selinux_set_callback(3), selinux(8)
55
56
57
58
59 18 Jun 2007 selabel_lookup(3)