Lines Matching full:context
34 * security context string representation of `context'.
36 int mls_compute_context_len(struct policydb *p, struct context *context) in mls_compute_context_len() argument
48 int index_sens = context->range.level[l].sens; in mls_compute_context_len()
54 e = &context->range.level[l].cat; in mls_compute_context_len()
73 if (mls_level_eq(&context->range.level[0], in mls_compute_context_len()
74 &context->range.level[1])) in mls_compute_context_len()
85 * Write the security context string representation of
86 * the MLS fields of `context' into the string `*scontext'.
90 struct context *context, in mls_sid_to_context() argument
108 context->range.level[l].sens - 1)); in mls_sid_to_context()
114 e = &context->range.level[l].cat; in mls_sid_to_context()
150 if (mls_level_eq(&context->range.level[0], in mls_sid_to_context()
151 &context->range.level[1])) in mls_sid_to_context()
190 * Return 1 if the MLS fields in the security context
193 int mls_context_isvalid(struct policydb *p, struct context *c) in mls_context_isvalid()
219 * Set the MLS fields in the security context structure
220 * `context' based on the string representation in
229 * copy the MLS field of the associated default context.
239 struct context *context, in mls_context_to_sid() argument
257 * No MLS component to the security context, try and map to in mls_context_to_sid()
261 struct context *defcon; in mls_context_to_sid()
270 rc = mls_context_cpy(context, defcon); in mls_context_to_sid()
290 context->range.level[l].sens = levdatum->level->sens; in mls_context_to_sid()
316 rc = ebitmap_set_bit(&context->range.level[l].cat, in mls_context_to_sid()
337 rc = ebitmap_set_bit(&context->range.level[l].cat, i, 1); in mls_context_to_sid()
361 context->range.level[1].sens = context->range.level[0].sens; in mls_context_to_sid()
362 rc = ebitmap_cpy(&context->range.level[1].cat, in mls_context_to_sid()
363 &context->range.level[0].cat); in mls_context_to_sid()
374 * Set the MLS fields in the security context structure
375 * `context' based on the string representation in
379 int mls_from_string(struct policydb *p, char *str, struct context *context, in mls_from_string() argument
394 rc = mls_context_to_sid(p, ':', &tmpstr, context, in mls_from_string()
403 * Copies the MLS range `range' into `context'.
405 int mls_range_set(struct context *context, in mls_range_set() argument
410 /* Copy the MLS range into the context */ in mls_range_set()
412 context->range.level[l].sens = range->level[l].sens; in mls_range_set()
413 rc = ebitmap_cpy(&context->range.level[l].cat, in mls_range_set()
423 struct context *fromcon, struct user_datum *user, in mls_setup_user_range()
424 struct context *usercon) in mls_setup_user_range()
462 * Convert the MLS fields in the security context
468 struct context *c) in mls_convert_context()
510 struct context *scontext, in mls_compute_sid()
511 struct context *tcontext, in mls_compute_sid()
514 struct context *newcontext, in mls_compute_sid()
576 * @context: the security context
580 * Given the security context copy the low MLS sensitivity level into the
585 struct context *context, in mls_export_netlbl_lvl() argument
591 secattr->attr.mls.lvl = context->range.level[0].sens - 1; in mls_export_netlbl_lvl()
597 * @context: the security context
601 * Given the security context and the NetLabel security attributes, copy the
602 * NetLabel MLS sensitivity level into the context.
606 struct context *context, in mls_import_netlbl_lvl() argument
612 context->range.level[0].sens = secattr->attr.mls.lvl + 1; in mls_import_netlbl_lvl()
613 context->range.level[1].sens = context->range.level[0].sens; in mls_import_netlbl_lvl()
618 * @context: the security context
622 * Given the security context copy the low MLS categories into the NetLabel
627 struct context *context, in mls_export_netlbl_cat() argument
635 rc = ebitmap_netlbl_export(&context->range.level[0].cat, in mls_export_netlbl_cat()
645 * @context: the security context
649 * Copy the NetLabel security attributes into the SELinux context; since the
651 * both the low and high categories of the context. Returns zero on success,
656 struct context *context, in mls_import_netlbl_cat() argument
664 rc = ebitmap_netlbl_import(&context->range.level[0].cat, in mls_import_netlbl_cat()
668 memcpy(&context->range.level[1].cat, &context->range.level[0].cat, in mls_import_netlbl_cat()
669 sizeof(context->range.level[0].cat)); in mls_import_netlbl_cat()
674 ebitmap_destroy(&context->range.level[0].cat); in mls_import_netlbl_cat()