[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1507383097088-1068794175-19-diffsplit-thomas@m3y3r.de>
Date: Sat, 07 Oct 2017 16:02:21 +0200
From: Thomas Meyer <thomas@...3r.de>
To: paul@...l-moore.com, sds@...ho.nsa.gov, eparis@...isplace.org,
james.l.morris@...cle.com, serge@...lyn.com, selinux@...ho.nsa.gov,
linux-security-module@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] selinux: Fix bool initialization/comparison
Bool initializations should use true and false. Bool tests don't need
comparisons.
Signed-off-by: Thomas Meyer <thomas@...3r.de>
---
diff -u -p a/security/selinux/ss/mls.c b/security/selinux/ss/mls.c
--- a/security/selinux/ss/mls.c
+++ b/security/selinux/ss/mls.c
@@ -550,7 +550,7 @@ int mls_compute_sid(struct context *scon
/* Fallthrough */
case AVTAB_CHANGE:
- if ((tclass == policydb.process_class) || (sock == true))
+ if ((tclass == policydb.process_class) || (sock))
/* Use the process MLS attributes. */
return mls_context_cpy(newcontext, scontext);
else
diff -u -p a/security/selinux/ss/services.c b/security/selinux/ss/services.c
--- a/security/selinux/ss/services.c
+++ b/security/selinux/ss/services.c
@@ -1656,7 +1656,7 @@ static int security_compute_sid(u32 ssid
} else if (cladatum && cladatum->default_role == DEFAULT_TARGET) {
newcontext.role = tcontext->role;
} else {
- if ((tclass == policydb.process_class) || (sock == true))
+ if ((tclass == policydb.process_class) || (sock))
newcontext.role = scontext->role;
else
newcontext.role = OBJECT_R_VAL;
@@ -1668,7 +1668,7 @@ static int security_compute_sid(u32 ssid
} else if (cladatum && cladatum->default_type == DEFAULT_TARGET) {
newcontext.type = tcontext->type;
} else {
- if ((tclass == policydb.process_class) || (sock == true)) {
+ if ((tclass == policydb.process_class) || (sock)) {
/* Use the type of process. */
newcontext.type = scontext->type;
} else {
Powered by blists - more mailing lists