Blame libselinux/include/selinux/context.h
|
Chris PeBenito |
473ea7 |
#ifndef _SELINUX_CONTEXT_H_
|
|
Chris PeBenito |
473ea7 |
#define _SELINUX_CONTEXT_H_
|
|
Chris PeBenito |
473ea7 |
|
|
Chris PeBenito |
473ea7 |
#ifdef __cplusplus
|
|
Chris PeBenito |
473ea7 |
extern "C"
|
|
Chris PeBenito |
473ea7 |
{
|
|
Chris PeBenito |
473ea7 |
#endif
|
|
Chris PeBenito |
473ea7 |
|
|
Chris PeBenito |
473ea7 |
/*
|
|
Chris PeBenito |
473ea7 |
* Functions to deal with security contexts in user space.
|
|
Chris PeBenito |
473ea7 |
*/
|
|
Chris PeBenito |
473ea7 |
|
|
Chris PeBenito |
473ea7 |
typedef struct {
|
|
Chris PeBenito |
473ea7 |
void * ptr;
|
|
Chris PeBenito |
473ea7 |
} context_s_t;
|
|
Chris PeBenito |
473ea7 |
|
|
Chris PeBenito |
473ea7 |
typedef context_s_t *context_t;
|
|
Chris PeBenito |
473ea7 |
|
|
Chris PeBenito |
473ea7 |
/* Return a new context initialized to a context string */
|
|
Chris PeBenito |
473ea7 |
|
|
Chris PeBenito |
473ea7 |
extern context_t context_new(const char *);
|
|
Chris PeBenito |
473ea7 |
|
|
Chris PeBenito |
473ea7 |
/*
|
|
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 |
|
|
Chris PeBenito |
473ea7 |
extern char* context_str(context_t);
|
|
Chris PeBenito |
473ea7 |
|
|
Chris PeBenito |
473ea7 |
/* Free the storage used by a context */
|
|
Chris PeBenito |
473ea7 |
extern void context_free(context_t);
|
|
Chris PeBenito |
473ea7 |
|
|
Chris PeBenito |
473ea7 |
/* Get a pointer to the string value of a context component */
|
|
Chris PeBenito |
473ea7 |
|
|
Chris PeBenito |
473ea7 |
extern const char* context_type_get(context_t);
|
|
Chris PeBenito |
473ea7 |
extern const char* context_range_get(context_t);
|
|
Chris PeBenito |
473ea7 |
extern const char* context_role_get(context_t);
|
|
Chris PeBenito |
473ea7 |
extern const char* context_user_get(context_t);
|
|
Chris PeBenito |
473ea7 |
|
|
Chris PeBenito |
473ea7 |
/* Set a context component. Returns nonzero if unsuccessful */
|
|
Chris PeBenito |
473ea7 |
|
|
Chris PeBenito |
473ea7 |
extern int context_type_set(context_t,const char*);
|
|
Chris PeBenito |
473ea7 |
extern int context_range_set(context_t,const char*);
|
|
Chris PeBenito |
473ea7 |
extern int context_role_set(context_t,const char*);
|
|
Chris PeBenito |
473ea7 |
extern int context_user_set(context_t,const char*);
|
|
Chris PeBenito |
473ea7 |
|
|
Chris PeBenito |
473ea7 |
#ifdef __cplusplus
|
|
Chris PeBenito |
473ea7 |
}
|
|
Chris PeBenito |
473ea7 |
#endif
|
|
Chris PeBenito |
473ea7 |
|
|
Chris PeBenito |
473ea7 |
#endif
|