Home | History | Annotate | Download | only in src

Lines Matching full:context

10 #include "context.h"
21 int sepol_check_context(const char *context)
24 return sepol_context_to_sid((const sepol_security_context_t)context,
25 strlen(context) + 1, NULL);
31 * Return 1 if the fields in the security context
81 * Write the security context string representation of
82 * the context structure `context' into a dynamically
89 const context_struct_t * context,
97 /* Compute the size of the context. */
99 strlen(policydb->p_user_val_to_name[context->user - 1]) + 1;
101 strlen(policydb->p_role_val_to_name[context->role - 1]) + 1;
102 scontext_len += strlen(policydb->p_type_val_to_name[context->type - 1]);
103 scontext_len += mls_compute_context_len(policydb, context);
108 /* Allocate space for the context; caller must free this space. */
115 * Copy the user name, role name and type name into the context.
119 policydb->p_user_val_to_name[context->user - 1],
120 policydb->p_role_val_to_name[context->role - 1],
121 policydb->p_type_val_to_name[context->type - 1]);
124 strlen(policydb->p_user_val_to_name[context->user - 1]) + 1 +
125 strlen(policydb->p_role_val_to_name[context->role - 1]) + 1 +
126 strlen(policydb->p_type_val_to_name[context->type - 1]);
128 mls_sid_to_context(policydb, context, &ptr);
135 ERR(handle, "out of memory, could not convert " "context to string");
141 * Create a context structure from the given record
196 ERR(handle, "MLS is disabled, but MLS context \"%s\" found",
200 ERR(handle, "MLS is enabled, but no MLS context found");
210 "invalid security context: \"%s:%s:%s:%s\"",
214 "invalid security context: \"%s:%s:%s\"",
235 ERR(handle, "could not create context structure");
240 * Create a record from the given context structure
244 const context_struct_t * context,
255 policydb->p_user_val_to_name[context->user -
260 policydb->p_role_val_to_name[context->role -
265 policydb->p_type_val_to_name[context->type -
270 if (mls_to_string(handle, policydb, context, &mls) < 0)
282 ERR(handle, "could not create context record");
289 * Create a context structure from the provided string.
322 ERR(handle, "could not create context structure");
330 const sepol_context_t * context)
334 int ret = context_from_record(handle, &policydb->p, &con, context);