提交 63a312ca 编写于 作者: H Harry Ciao 提交者: Eric Paris

SELinux: Compute role in newcontext for all classes

Apply role_transition rules for all kinds of classes.
Signed-off-by: NHarry Ciao <qingtao.cao@windriver.com>
Acked-by: NStephen Smalley <sds@tycho.nsa.gov>
Signed-off-by: NEric Paris <eparis@redhat.com>
上级 8023976c
...@@ -1484,20 +1484,18 @@ static int security_compute_sid(u32 ssid, ...@@ -1484,20 +1484,18 @@ static int security_compute_sid(u32 ssid,
tcontext->type, tclass, qstr); tcontext->type, tclass, qstr);
/* Check for class-specific changes. */ /* Check for class-specific changes. */
if (tclass == policydb.process_class) {
if (specified & AVTAB_TRANSITION) { if (specified & AVTAB_TRANSITION) {
/* Look for a role transition rule. */ /* Look for a role transition rule. */
for (roletr = policydb.role_tr; roletr; for (roletr = policydb.role_tr; roletr; roletr = roletr->next) {
roletr = roletr->next) { if ((roletr->role == scontext->role) &&
if (roletr->role == scontext->role && (roletr->type == tcontext->type) &&
roletr->type == tcontext->type) { (roletr->tclass == tclass)) {
/* Use the role transition rule. */ /* Use the role transition rule. */
newcontext.role = roletr->new_role; newcontext.role = roletr->new_role;
break; break;
} }
} }
} }
}
/* Set the MLS attributes. /* Set the MLS attributes.
This is done last because it may allocate memory. */ This is done last because it may allocate memory. */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册