mirror of
https://github.com/SELinuxProject/selinux
synced 2025-03-01 07:50:38 +00:00
checkpolicy: dispol: print role transition rules
There was no way to print all of the role transition rules in dispol. Add that support. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
510003b63f
commit
aec2e0265c
@ -341,6 +341,20 @@ static void display_permissive(policydb_t *p, FILE *fp)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void display_role_trans(policydb_t *p, FILE *fp)
|
||||||
|
{
|
||||||
|
role_trans_t *rt;
|
||||||
|
|
||||||
|
fprintf(fp, "role_trans rules:\n");
|
||||||
|
for (rt = p->role_tr; rt; rt = rt->next) {
|
||||||
|
display_id(p, fp, SYM_ROLES, rt->role - 1, "");
|
||||||
|
display_id(p, fp, SYM_TYPES, rt->type - 1, "");
|
||||||
|
display_id(p, fp, SYM_CLASSES, rt->tclass - 1, ":");
|
||||||
|
display_id(p, fp, SYM_ROLES, rt->new_role - 1, "");
|
||||||
|
fprintf(fp, "\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void display_filename_trans(policydb_t *p, FILE *fp)
|
static void display_filename_trans(policydb_t *p, FILE *fp)
|
||||||
{
|
{
|
||||||
filename_trans_t *ft;
|
filename_trans_t *ft;
|
||||||
@ -365,6 +379,7 @@ int menu()
|
|||||||
printf("5) display conditional bools\n");
|
printf("5) display conditional bools\n");
|
||||||
printf("6) display conditional expressions\n");
|
printf("6) display conditional expressions\n");
|
||||||
printf("7) change a boolean value\n");
|
printf("7) change a boolean value\n");
|
||||||
|
printf("8) display role transitions\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("c) display policy capabilities\n");
|
printf("c) display policy capabilities\n");
|
||||||
printf("p) display the list of permissive types\n");
|
printf("p) display the list of permissive types\n");
|
||||||
@ -483,6 +498,9 @@ int main(int argc, char **argv)
|
|||||||
change_bool(name, state, &policydb, out_fp);
|
change_bool(name, state, &policydb, out_fp);
|
||||||
free(name);
|
free(name);
|
||||||
break;
|
break;
|
||||||
|
case '8':
|
||||||
|
display_role_trans(&policydb, out_fp);
|
||||||
|
break;
|
||||||
case 'c':
|
case 'c':
|
||||||
display_policycaps(&policydb, out_fp);
|
display_policycaps(&policydb, out_fp);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user