diff options
author | James Bottomley <jejb@sparkweed.localdomain> | 2006-09-23 22:03:52 -0400 |
---|---|---|
committer | James Bottomley <jejb@sparkweed.localdomain> | 2006-09-23 22:03:52 -0400 |
commit | 1aedf2ccc60fade26c46fae12e28664d0da3f199 (patch) | |
tree | d91083e3079f1ddb942a382ac2b5a7525570ad59 /security/selinux/ss/mls.h | |
parent | dfdc58ba354adb80d67c99f7be84f95a8e02e466 (diff) | |
parent | 1ab9dd0902df4f4ff56fbf672220549090ab28ba (diff) |
Merge mulgrave-w:git/linux-2.6
Conflicts:
include/linux/blkdev.h
Trivial merge to incorporate tag prototypes.
Diffstat (limited to 'security/selinux/ss/mls.h')
-rw-r--r-- | security/selinux/ss/mls.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/security/selinux/ss/mls.h b/security/selinux/ss/mls.h index fbb42f07dd7c..df6032c6d492 100644 --- a/security/selinux/ss/mls.h +++ b/security/selinux/ss/mls.h | |||
@@ -10,6 +10,13 @@ | |||
10 | * | 10 | * |
11 | * Copyright (C) 2004-2006 Trusted Computer Solutions, Inc. | 11 | * Copyright (C) 2004-2006 Trusted Computer Solutions, Inc. |
12 | */ | 12 | */ |
13 | /* | ||
14 | * Updated: Hewlett-Packard <paul.moore@hp.com> | ||
15 | * | ||
16 | * Added support to import/export the MLS label | ||
17 | * | ||
18 | * (c) Copyright Hewlett-Packard Development Company, L.P., 2006 | ||
19 | */ | ||
13 | 20 | ||
14 | #ifndef _SS_MLS_H_ | 21 | #ifndef _SS_MLS_H_ |
15 | #define _SS_MLS_H_ | 22 | #define _SS_MLS_H_ |
@@ -17,6 +24,26 @@ | |||
17 | #include "context.h" | 24 | #include "context.h" |
18 | #include "policydb.h" | 25 | #include "policydb.h" |
19 | 26 | ||
27 | /* | ||
28 | * Copies the MLS range from `src' into `dst'. | ||
29 | */ | ||
30 | static inline int mls_copy_context(struct context *dst, | ||
31 | struct context *src) | ||
32 | { | ||
33 | int l, rc = 0; | ||
34 | |||
35 | /* Copy the MLS range from the source context */ | ||
36 | for (l = 0; l < 2; l++) { | ||
37 | dst->range.level[l].sens = src->range.level[l].sens; | ||
38 | rc = ebitmap_cpy(&dst->range.level[l].cat, | ||
39 | &src->range.level[l].cat); | ||
40 | if (rc) | ||
41 | break; | ||
42 | } | ||
43 | |||
44 | return rc; | ||
45 | } | ||
46 | |||
20 | int mls_compute_context_len(struct context *context); | 47 | int mls_compute_context_len(struct context *context); |
21 | void mls_sid_to_context(struct context *context, char **scontext); | 48 | void mls_sid_to_context(struct context *context, char **scontext); |
22 | int mls_context_isvalid(struct policydb *p, struct context *c); | 49 | int mls_context_isvalid(struct policydb *p, struct context *c); |
@@ -42,5 +69,19 @@ int mls_compute_sid(struct context *scontext, | |||
42 | int mls_setup_user_range(struct context *fromcon, struct user_datum *user, | 69 | int mls_setup_user_range(struct context *fromcon, struct user_datum *user, |
43 | struct context *usercon); | 70 | struct context *usercon); |
44 | 71 | ||
72 | void mls_export_lvl(const struct context *context, u32 *low, u32 *high); | ||
73 | void mls_import_lvl(struct context *context, u32 low, u32 high); | ||
74 | |||
75 | int mls_export_cat(const struct context *context, | ||
76 | unsigned char **low, | ||
77 | size_t *low_len, | ||
78 | unsigned char **high, | ||
79 | size_t *high_len); | ||
80 | int mls_import_cat(struct context *context, | ||
81 | const unsigned char *low, | ||
82 | size_t low_len, | ||
83 | const unsigned char *high, | ||
84 | size_t high_len); | ||
85 | |||
45 | #endif /* _SS_MLS_H */ | 86 | #endif /* _SS_MLS_H */ |
46 | 87 | ||