-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This patch looks good to me. acked. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk4nLzkACgkQrlYvE4MpobOdMgCfSDZ4Is7G7HYhWevpPYqIhFDu 7xwAoNuTFZBD6Z0Hcb+fesLQlz3IRHCS =PFno -----END PGP SIGNATURE-----
>From 96b4935b36255693fb9f4bf5dfef9f00938b6548 Mon Sep 17 00:00:00 2001 From: Eric Paris <eparis@xxxxxxxxxx> Date: Wed, 20 Apr 2011 15:41:05 -0400 Subject: [PATCH 03/93] checkpolicy: fix dispol/dismod display for filename trans rules The formatting of dismod/dispol display of filename trans rules didn't make a lot of sense. Make them more like the original rules. Signed-off-by: Eric Paris <eparis@xxxxxxxxxx> --- checkpolicy/test/dismod.c | 7 +++---- checkpolicy/test/dispol.c | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/checkpolicy/test/dismod.c b/checkpolicy/test/dismod.c index 66f976f..1674a47 100644 --- a/checkpolicy/test/dismod.c +++ b/checkpolicy/test/dismod.c @@ -506,15 +506,15 @@ void display_role_allow(role_allow_rule_t * ra, policydb_t * p, FILE * fp) } } -void display_filename_trans(filename_trans_rule_t * tr, policydb_t * p, FILE * fp) +static void display_filename_trans(filename_trans_rule_t * tr, policydb_t * p, FILE * fp) { + fprintf(fp, "filename transition"); for (; tr; tr = tr->next) { - fprintf(fp, "filename transition %s", tr->name); display_type_set(&tr->stypes, 0, p, fp); display_type_set(&tr->ttypes, 0, p, fp); display_id(p, fp, SYM_CLASSES, tr->tclass - 1, ":"); display_id(p, fp, SYM_TYPES, tr->otype - 1, ""); - fprintf(fp, "\n"); + fprintf(fp, " %s\n", tr->name); } } @@ -688,7 +688,6 @@ int display_avdecl(avrule_decl_t * decl, int field, uint32_t what, case DISPLAY_AVBLOCK_FILENAME_TRANS: display_filename_trans(decl->filename_trans_rules, policy, out_fp); - return -1; break; default:{ assert(0); diff --git a/checkpolicy/test/dispol.c b/checkpolicy/test/dispol.c index ee2cf02..4153191 100644 --- a/checkpolicy/test/dispol.c +++ b/checkpolicy/test/dispol.c @@ -347,12 +347,11 @@ static void display_filename_trans(policydb_t *p, FILE *fp) fprintf(fp, "filename_trans rules:\n"); for (ft = p->filename_trans; ft; ft = ft->next) { - fprintf(fp, "%s\n", ft->name); display_id(p, fp, SYM_TYPES, ft->stype - 1, ""); display_id(p, fp, SYM_TYPES, ft->ttype - 1, ""); display_id(p, fp, SYM_CLASSES, ft->tclass - 1, ":"); display_id(p, fp, SYM_TYPES, ft->otype - 1, ""); - fprintf(fp, "\n"); + fprintf(fp, "%s\n", ft->name); } } -- 1.7.6
Attachment:
0003-checkpolicy-fix-dispol-dismod-display-for-filename-t.patch.sig
Description: PGP signature