diff options
author | Venkat Yekkirala <vyekkirala@TrustedCS.com> | 2006-12-12 14:02:41 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2007-01-08 17:32:51 -0500 |
commit | 0efc61eaee5471acd7399c8536feff280b4966dd (patch) | |
tree | c57dbd32f8a318082ba4f35092b5679d23cfb184 /security/selinux/ss/context.h | |
parent | bf81b46482c0fa8ea638e409d39768ea92a6b0f0 (diff) |
selinux: Delete mls_copy_context
This deletes mls_copy_context() in favor of mls_context_cpy() and
replaces mls_scopy_context() with mls_context_cpy_low().
Signed-off-by: Venkat Yekkirala <vyekkirala@TrustedCS.com>
Acked-by: Stephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'security/selinux/ss/context.h')
-rw-r--r-- | security/selinux/ss/context.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/security/selinux/ss/context.h b/security/selinux/ss/context.h index 0562bacb7b99..2eee0dab524d 100644 --- a/security/selinux/ss/context.h +++ b/security/selinux/ss/context.h | |||
@@ -55,6 +55,29 @@ out: | |||
55 | return rc; | 55 | return rc; |
56 | } | 56 | } |
57 | 57 | ||
58 | /* | ||
59 | * Sets both levels in the MLS range of 'dst' to the low level of 'src'. | ||
60 | */ | ||
61 | static inline int mls_context_cpy_low(struct context *dst, struct context *src) | ||
62 | { | ||
63 | int rc; | ||
64 | |||
65 | if (!selinux_mls_enabled) | ||
66 | return 0; | ||
67 | |||
68 | dst->range.level[0].sens = src->range.level[0].sens; | ||
69 | rc = ebitmap_cpy(&dst->range.level[0].cat, &src->range.level[0].cat); | ||
70 | if (rc) | ||
71 | goto out; | ||
72 | |||
73 | dst->range.level[1].sens = src->range.level[0].sens; | ||
74 | rc = ebitmap_cpy(&dst->range.level[1].cat, &src->range.level[0].cat); | ||
75 | if (rc) | ||
76 | ebitmap_destroy(&dst->range.level[0].cat); | ||
77 | out: | ||
78 | return rc; | ||
79 | } | ||
80 | |||
58 | static inline int mls_context_cmp(struct context *c1, struct context *c2) | 81 | static inline int mls_context_cmp(struct context *c1, struct context *c2) |
59 | { | 82 | { |
60 | if (!selinux_mls_enabled) | 83 | if (!selinux_mls_enabled) |