Skip to content

Commit

Permalink
SELinux: Compute role in newcontext for all classes
Browse files Browse the repository at this point in the history
Apply role_transition rules for all kinds of classes.

Signed-off-by: Harry Ciao <[email protected]>
Acked-by:  Stephen Smalley <[email protected]>
Signed-off-by: Eric Paris <[email protected]>
  • Loading branch information
Harry Ciao authored and eparis committed Mar 28, 2011
1 parent 8023976 commit 63a312c
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions security/selinux/ss/services.c
Original file line number Diff line number Diff line change
Expand Up @@ -1484,17 +1484,15 @@ static int security_compute_sid(u32 ssid,
tcontext->type, tclass, qstr);

/* Check for class-specific changes. */
if (tclass == policydb.process_class) {
if (specified & AVTAB_TRANSITION) {
/* Look for a role transition rule. */
for (roletr = policydb.role_tr; roletr;
roletr = roletr->next) {
if (roletr->role == scontext->role &&
roletr->type == tcontext->type) {
/* Use the role transition rule. */
newcontext.role = roletr->new_role;
break;
}
if (specified & AVTAB_TRANSITION) {
/* Look for a role transition rule. */
for (roletr = policydb.role_tr; roletr; roletr = roletr->next) {
if ((roletr->role == scontext->role) &&
(roletr->type == tcontext->type) &&
(roletr->tclass == tclass)) {
/* Use the role transition rule. */
newcontext.role = roletr->new_role;
break;
}
}
}
Expand Down

0 comments on commit 63a312c

Please sign in to comment.