Chris PeBenito 473ea7
.TH "context_new" "3" "15 November 2004" "dwalsh@redhat.com" "SELinux API documentation"
Chris PeBenito 473ea7
.SH "NAME"
Chris PeBenito 473ea7
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
Chris PeBenito 473ea7
Chris PeBenito 473ea7
.SH "SYNOPSIS"
Chris PeBenito 473ea7
.B #include <selinux/context.h>
Chris PeBenito 473ea7
.br 
Chris PeBenito 473ea7
.B "context_t context_new(const char *" context_str );
Chris PeBenito 473ea7
.br 
Chris PeBenito 473ea7
.B "const char * context_str(context_t " con );
Chris PeBenito 473ea7
.br 
Chris PeBenito 473ea7
.B "void context_free(context_t " con );
Chris PeBenito 473ea7
.br 
Chris PeBenito 473ea7
.B "const char * context_type_get(context_t " con );
Chris PeBenito 473ea7
.br 
Chris PeBenito 473ea7
.B "const char * context_range_get(context_t " con );
Chris PeBenito 473ea7
.br 
Chris PeBenito 473ea7
.B "const char * context_role_get(context_t " con );
Chris PeBenito 473ea7
.br 
Chris PeBenito 473ea7
.B "const char * context_user_get(context_t " con );
Chris PeBenito 473ea7
.br 
Chris PeBenito 473ea7
.B "const char * context_type_set(context_t " con ", const char* " type);
Chris PeBenito 473ea7
.br 
Chris PeBenito 473ea7
.B "const char * context_range_set(context_t " con ", const char* " range);
Chris PeBenito 473ea7
.br 
Chris PeBenito 473ea7
.B "const char * context_role_set(context_t " con ", const char* " role );
Chris PeBenito 473ea7
.br 
Chris PeBenito 473ea7
.B "const char * context_user_set(context_t " con ", const char* " user );
Chris PeBenito 473ea7
Chris PeBenito 473ea7
.SH "DESCRIPTION"
Chris PeBenito 473ea7
These functions allow an application to manipulate the fields of a
Chris PeBenito 473ea7
security context string without requiring it to know the format of the
Chris PeBenito 473ea7
string.
Chris PeBenito 473ea7
Chris PeBenito 473ea7
context_new
Chris PeBenito 473ea7
 Return a new context initialized to a context string 
Chris PeBenito 473ea7
Chris PeBenito 473ea7
context_str
Chris PeBenito 473ea7
Return a pointer to the string value of the context_t
Chris PeBenito 473ea7
Valid until the next call to context_str or context_free 
Chris PeBenito 473ea7
for the same context_t*
Chris PeBenito 473ea7
Chris PeBenito 473ea7
context_free
Chris PeBenito 473ea7
Free the storage used by a context
Chris PeBenito 473ea7
Chris PeBenito 473ea7
context_type_get, context_range_get, context_role_get, context_user_get
Chris PeBenito 473ea7
Get a pointer to the string value of a context component
Chris PeBenito 473ea7
Chris PeBenito 473ea7
NOTE: Values returned by the get functions are only valid until the next call 
Chris PeBenito 473ea7
to a set function or context_free() for the same context_t structure.
Chris PeBenito 473ea7
Chris PeBenito 473ea7
context_type_set, context_range_set, context_role_set, context_user_set
Chris PeBenito 473ea7
Set a context component
Chris PeBenito 473ea7
Chris PeBenito 473ea7
.SH "RETURN VALUE"
Chris PeBenito 473ea7
On success, zero is returned. On failure, -1 is returned and errno is
Chris PeBenito 473ea7
set appropriately.
Chris PeBenito 473ea7