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()
189 * Return 1 if the MLS fields in the security context
192 int mls_context_isvalid(struct policydb *p, struct context *c) in mls_context_isvalid()
218 * Set the MLS fields in the security context structure
219 * `context' based on the string representation in
226 * copy the MLS field of the associated default context.
236 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 return mls_context_cpy(context, defcon); in mls_context_to_sid()
298 context->range.level[l].sens = levdatum->level->sens; in mls_context_to_sid()
318 rc = ebitmap_set_bit(&context->range.level[l].cat, in mls_context_to_sid()
335 rc = ebitmap_set_bit(&context->range.level[l].cat, i, 1); in mls_context_to_sid()
344 context->range.level[1].sens = context->range.level[0].sens; in mls_context_to_sid()
345 rc = ebitmap_cpy(&context->range.level[1].cat, in mls_context_to_sid()
346 &context->range.level[0].cat); in mls_context_to_sid()
355 * Set the MLS fields in the security context structure
356 * `context' based on the string representation in
360 int mls_from_string(struct policydb *p, char *str, struct context *context, in mls_from_string() argument
373 rc = mls_context_to_sid(p, ':', tmpstr, context, in mls_from_string()
382 * Copies the MLS range `range' into `context'.
384 int mls_range_set(struct context *context, in mls_range_set() argument
389 /* Copy the MLS range into the context */ in mls_range_set()
391 context->range.level[l].sens = range->level[l].sens; in mls_range_set()
392 rc = ebitmap_cpy(&context->range.level[l].cat, in mls_range_set()
402 struct context *fromcon, struct user_datum *user, in mls_setup_user_range()
403 struct context *usercon) in mls_setup_user_range()
441 * Convert the MLS fields in the security context
444 * storing the resulting context in `newc'.
448 struct context *oldc, in mls_convert_context()
449 struct context *newc) in mls_convert_context()
488 struct context *scontext, in mls_compute_sid()
489 struct context *tcontext, in mls_compute_sid()
492 struct context *newcontext, in mls_compute_sid()
556 * @context: the security context
560 * Given the security context copy the low MLS sensitivity level into the
565 struct context *context, in mls_export_netlbl_lvl() argument
571 secattr->attr.mls.lvl = context->range.level[0].sens - 1; in mls_export_netlbl_lvl()
578 * @context: the security context
582 * Given the security context and the NetLabel security attributes, copy the
583 * NetLabel MLS sensitivity level into the context.
587 struct context *context, in mls_import_netlbl_lvl() argument
593 context->range.level[0].sens = secattr->attr.mls.lvl + 1; in mls_import_netlbl_lvl()
594 context->range.level[1].sens = context->range.level[0].sens; in mls_import_netlbl_lvl()
600 * @context: the security context
604 * Given the security context copy the low MLS categories into the NetLabel
609 struct context *context, in mls_export_netlbl_cat() argument
617 rc = ebitmap_netlbl_export(&context->range.level[0].cat, in mls_export_netlbl_cat()
628 * @context: the security context
632 * Copy the NetLabel security attributes into the SELinux context; since the
634 * both the low and high categories of the context. Returns zero on success,
639 struct context *context, in mls_import_netlbl_cat() argument
647 rc = ebitmap_netlbl_import(&context->range.level[0].cat, in mls_import_netlbl_cat()
651 memcpy(&context->range.level[1].cat, &context->range.level[0].cat, in mls_import_netlbl_cat()
652 sizeof(context->range.level[0].cat)); in mls_import_netlbl_cat()
657 ebitmap_destroy(&context->range.level[0].cat); in mls_import_netlbl_cat()