Lines Matching defs:context

34  * security context string representation of `context'.
36 int mls_compute_context_len(struct policydb *p, struct context *context)
48 u32 index_sens = context->range.level[l].sens;
54 e = &context->range.level[l].cat;
73 if (mls_level_eq(&context->range.level[0],
74 &context->range.level[1]))
85 * Write the security context string representation of
86 * the MLS fields of `context' into the string `*scontext'.
90 struct context *context,
108 context->range.level[l].sens - 1));
114 e = &context->range.level[l].cat;
150 if (mls_level_eq(&context->range.level[0],
151 &context->range.level[1]))
189 * Return 1 if the MLS fields in the security context
192 int mls_context_isvalid(struct policydb *p, struct context *c)
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,
258 * No MLS component to the security context, try and map to
262 struct context *defcon;
271 return mls_context_cpy(context, defcon);
299 context->range.level[l].sens = levdatum->level->sens;
319 rc = ebitmap_set_bit(&context->range.level[l].cat,
336 rc = ebitmap_set_bit(&context->range.level[l].cat, i, 1);
345 context->range.level[1].sens = context->range.level[0].sens;
346 rc = ebitmap_cpy(&context->range.level[1].cat,
347 &context->range.level[0].cat);
356 * Set the MLS fields in the security context structure
357 * `context' based on the string representation in
361 int mls_from_string(struct policydb *p, char *str, struct context *context,
374 rc = mls_context_to_sid(p, ':', tmpstr, context,
383 * Copies the MLS range `range' into `context'.
385 int mls_range_set(struct context *context,
390 /* Copy the MLS range into the context */
392 context->range.level[l].sens = range->level[l].sens;
393 rc = ebitmap_cpy(&context->range.level[l].cat,
403 struct context *fromcon, struct user_datum *user,
404 struct context *usercon)
442 * Convert the MLS fields in the security context
445 * storing the resulting context in `newc'.
449 struct context *oldc,
450 struct context *newc)
490 struct context *scontext,
491 struct context *tcontext,
494 struct context *newcontext,
558 * @context: the security context
562 * Given the security context copy the low MLS sensitivity level into the
567 struct context *context,
573 secattr->attr.mls.lvl = context->range.level[0].sens - 1;
580 * @context: the security context
584 * Given the security context and the NetLabel security attributes, copy the
585 * NetLabel MLS sensitivity level into the context.
589 struct context *context,
595 context->range.level[0].sens = secattr->attr.mls.lvl + 1;
596 context->range.level[1].sens = context->range.level[0].sens;
602 * @context: the security context
606 * Given the security context copy the low MLS categories into the NetLabel
611 struct context *context,
619 rc = ebitmap_netlbl_export(&context->range.level[0].cat,
630 * @context: the security context
634 * Copy the NetLabel security attributes into the SELinux context; since the
636 * both the low and high categories of the context. Returns zero on success,
641 struct context *context,
649 rc = ebitmap_netlbl_import(&context->range.level[0].cat,
653 memcpy(&context->range.level[1].cat, &context->range.level[0].cat,
654 sizeof(context->range.level[0].cat));
659 ebitmap_destroy(&context->range.level[0].cat);