Commit fd5a90ff authored by Christian Göttsche's avatar Christian Göttsche Committed by Paul Moore

selinux: avoid implicit conversions in mls code

Use u32 for ebitmap bits and sensitivity levels, char for the default
range of a class.
Signed-off-by: default avatarChristian Göttsche <cgzones@googlemail.com>
[PM: description tweaks]
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent c17c55c2
......@@ -45,7 +45,7 @@ int mls_compute_context_len(struct policydb *p, struct context *context)
len = 1; /* for the beginning ":" */
for (l = 0; l < 2; l++) {
int index_sens = context->range.level[l].sens;
u32 index_sens = context->range.level[l].sens;
len += strlen(sym_name(p, SYM_LEVELS, index_sens - 1));
/* categories */
......@@ -240,7 +240,8 @@ int mls_context_to_sid(struct policydb *pol,
char *sensitivity, *cur_cat, *next_cat, *rngptr;
struct level_datum *levdatum;
struct cat_datum *catdatum, *rngdatum;
int l, rc, i;
u32 i;
int l, rc;
char *rangep[2];
if (!pol->mls_enabled) {
......@@ -451,7 +452,8 @@ int mls_convert_context(struct policydb *oldp,
struct level_datum *levdatum;
struct cat_datum *catdatum;
struct ebitmap_node *node;
int l, i;
u32 i;
int l;
if (!oldp->mls_enabled || !newp->mls_enabled)
return 0;
......@@ -495,7 +497,7 @@ int mls_compute_sid(struct policydb *p,
struct range_trans rtr;
struct mls_range *r;
struct class_datum *cladatum;
int default_range = 0;
char default_range = 0;
if (!p->mls_enabled)
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment