forked from luck/tmp_suning_uos_patched
SELinux: Compute role in newcontext for all classes
Apply role_transition rules for all kinds of classes. Signed-off-by: Harry Ciao <qingtao.cao@windriver.com> Acked-by: Stephen Smalley <sds@tycho.nsa.gov> Signed-off-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
parent
8023976cf4
commit
63a312ca55
|
@ -1484,17 +1484,15 @@ 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; roletr = roletr->next) {
|
||||||
for (roletr = policydb.role_tr; roletr;
|
if ((roletr->role == scontext->role) &&
|
||||||
roletr = roletr->next) {
|
(roletr->type == tcontext->type) &&
|
||||||
if (roletr->role == scontext->role &&
|
(roletr->tclass == tclass)) {
|
||||||
roletr->type == tcontext->type) {
|
/* Use the role transition rule. */
|
||||||
/* Use the role transition rule. */
|
newcontext.role = roletr->new_role;
|
||||||
newcontext.role = roletr->new_role;
|
break;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user