aboutsummaryrefslogtreecommitdiffstats
path: root/libselinux/man/man3/context_new.3
blob: f36bd2567eb5b997450ec9c1b59c8370cf84c468 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.TH "context_new" "3" "15 November 2004" "dwalsh@redhat.com" "SELinux API documentation"
.SH "NAME"
context_new, context_str, context_free, context_type_get, context_type_set, context_range_get, context_range_set,context_role_get, context_role_set, context_user_get, context_user_set \- Routines to manipulate SELinux security contexts

.SH "SYNOPSIS"
.B #include <selinux/context.h>

.B "context_t context_new(const char *" context_str );

.B "const char * context_str(context_t " con );

.B "void context_free(context_t " con );

.B "const char * context_type_get(context_t " con );

.B "const char * context_range_get(context_t " con );

.B "const char * context_role_get(context_t " con );

.B "const char * context_user_get(context_t " con );

.B "const char * context_type_set(context_t " con ", const char* " type);

.B "const char * context_range_set(context_t " con ", const char* " range);

.B "const char * context_role_set(context_t " con ", const char* " role );

.B "const char * context_user_set(context_t " con ", const char* " user );

.SH "DESCRIPTION"
These functions allow an application to manipulate the fields of a
security context string without requiring it to know the format of the
string.

context_new
 Return a new context initialized to a context string 

context_str
Return a pointer to the string value of the context_t
Valid until the next call to context_str or context_free 
for the same context_t*

context_free
Free the storage used by a context

context_type_get, context_range_get, context_role_get, context_user_get
Get a pointer to the string value of a context component

NOTE: Values returned by the get functions are only valid until the next call 
to a set function or context_free() for the same context_t structure.

context_type_set, context_range_set, context_role_set, context_user_set
Set a context component

.SH "RETURN VALUE"
On success, zero is returned. On failure, -1 is returned and errno is
set appropriately.

.SH "SEE ALSO"
.BR selinux "(8)"