Commit 4b850396 authored by Zou Wei's avatar Zou Wei Committed by Paul Moore

selinux: fix warning Comparison to bool

fix below warnings reported by coccicheck

security/selinux/ss/mls.c:539:39-43: WARNING: Comparison to bool
security/selinux/ss/services.c:1815:46-50: WARNING: Comparison to bool
security/selinux/ss/services.c:1827:46-50: WARNING: Comparison to bool
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarZou Wei <zou_wei@huawei.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
parent 8f3d9f35
...@@ -536,7 +536,7 @@ int mls_compute_sid(struct policydb *p, ...@@ -536,7 +536,7 @@ int mls_compute_sid(struct policydb *p,
/* Fallthrough */ /* Fallthrough */
case AVTAB_CHANGE: case AVTAB_CHANGE:
if ((tclass == p->process_class) || (sock == true)) if ((tclass == p->process_class) || sock)
/* Use the process MLS attributes. */ /* Use the process MLS attributes. */
return mls_context_cpy(newcontext, scontext); return mls_context_cpy(newcontext, scontext);
else else
......
...@@ -1812,7 +1812,7 @@ static int security_compute_sid(struct selinux_state *state, ...@@ -1812,7 +1812,7 @@ static int security_compute_sid(struct selinux_state *state,
} else if (cladatum && cladatum->default_role == DEFAULT_TARGET) { } else if (cladatum && cladatum->default_role == DEFAULT_TARGET) {
newcontext.role = tcontext->role; newcontext.role = tcontext->role;
} else { } else {
if ((tclass == policydb->process_class) || (sock == true)) if ((tclass == policydb->process_class) || sock)
newcontext.role = scontext->role; newcontext.role = scontext->role;
else else
newcontext.role = OBJECT_R_VAL; newcontext.role = OBJECT_R_VAL;
...@@ -1824,7 +1824,7 @@ static int security_compute_sid(struct selinux_state *state, ...@@ -1824,7 +1824,7 @@ static int security_compute_sid(struct selinux_state *state,
} else if (cladatum && cladatum->default_type == DEFAULT_TARGET) { } else if (cladatum && cladatum->default_type == DEFAULT_TARGET) {
newcontext.type = tcontext->type; newcontext.type = tcontext->type;
} else { } else {
if ((tclass == policydb->process_class) || (sock == true)) { if ((tclass == policydb->process_class) || sock) {
/* Use the type of process. */ /* Use the type of process. */
newcontext.type = scontext->type; newcontext.type = scontext->type;
} else { } else {
......
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