Lines Matching defs:context
34 * security context string representation of `context'.
36 int mls_compute_context_len(struct policydb *p, struct context *context)
48 int 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]))
190 * Return 1 if the MLS fields in the security context
193 int mls_context_isvalid(struct policydb *p, struct context *c)
219 * Set the MLS fields in the security context structure
220 * `context' based on the string representation in
227 * copy the MLS field of the associated default context.
237 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)
489 struct context *scontext,
490 struct context *tcontext,
493 struct context *newcontext,
556 * @context: the security context
560 * Given the security context copy the low MLS sensitivity level into the
565 struct context *context,
571 secattr->attr.mls.lvl = context->range.level[0].sens - 1;
577 * @context: the security context
581 * Given the security context and the NetLabel security attributes, copy the
582 * NetLabel MLS sensitivity level into the context.
586 struct context *context,
592 context->range.level[0].sens = secattr->attr.mls.lvl + 1;
593 context->range.level[1].sens = context->range.level[0].sens;
598 * @context: the security context
602 * Given the security context copy the low MLS categories into the NetLabel
607 struct context *context,
615 rc = ebitmap_netlbl_export(&context->range.level[0].cat,
625 * @context: the security context
629 * Copy the NetLabel security attributes into the SELinux context; since the
631 * both the low and high categories of the context. Returns zero on success,
636 struct context *context,
644 rc = ebitmap_netlbl_import(&context->range.level[0].cat,
648 memcpy(&context->range.level[1].cat, &context->range.level[0].cat,
649 sizeof(context->range.level[0].cat));
654 ebitmap_destroy(&context->range.level[0].cat);