From: Joshua Brindle <method@manicmethod.com>
To: Harry Ciao <qingtao.cao@windriver.com>
Cc: sds@tycho.nsa.gov, jmorris@namei.org, eparis@parisplace.org,
selinux@tycho.nsa.gov, Stephen Lawrence <slawrence@tresys.com>
Subject: Re: [v2 PATCH 5/5] Userspace: display the class in role_transition rule
Date: Mon, 28 Mar 2011 17:28:57 -0400 [thread overview]
Message-ID: <4D90FD99.90009@manicmethod.com> (raw)
In-Reply-To: <1301032323-20363-9-git-send-email-qingtao.cao@windriver.com>
I've reviewed the 5 userspace patches and they look good. I'll wait until
someone (Steve Lawrence?) actually compiles and tests before acking.
Harry Ciao wrote:
> Add support to display the class field in the role_transition rule
> in the checkpolicy/test/dismod program.
>
> Signed-off-by: Harry Ciao<qingtao.cao@windriver.com>
> ---
> checkpolicy/test/dismod.c | 27 ++++++++++++++++++++++++++-
> 1 files changed, 26 insertions(+), 1 deletions(-)
>
> diff --git a/checkpolicy/test/dismod.c b/checkpolicy/test/dismod.c
> index 4d31597..33a29e4 100644
> --- a/checkpolicy/test/dismod.c
> +++ b/checkpolicy/test/dismod.c
> @@ -451,13 +451,38 @@ void display_initial_sids(policydb_t * p, FILE * fp)
> #endif
> }
>
> +void display_class_set(ebitmap_t *classes, policydb_t *p, FILE *fp)
> +{
> + int i, num = 0;
> +
> + for (i = ebitmap_startbit(classes); i< ebitmap_length(classes); i++) {
> + if (!ebitmap_get_bit(classes, i))
> + continue;
> + num++;
> + if (num> 1) {
> + fprintf(fp, "{");
> + break;
> + }
> + }
> +
> + for (i = ebitmap_startbit(classes); i< ebitmap_length(classes); i++) {
> + if (ebitmap_get_bit(classes, i))
> + display_id(p, fp, SYM_CLASSES, i, "");
> + }
> +
> + if (num> 1)
> + fprintf(fp, " }");
> +}
> +
> void display_role_trans(role_trans_rule_t * tr, policydb_t * p, FILE * fp)
> {
> for (; tr; tr = tr->next) {
> fprintf(fp, "role transition ");
> display_mod_role_set(&tr->roles, p, fp);
> display_type_set(&tr->types, 0, p, fp);
> - display_id(p, fp, SYM_ROLES, tr->new_role - 1, " :");
> + fprintf(fp, " :");
> + display_class_set(&tr->classes, p, fp);
> + display_id(p, fp, SYM_ROLES, tr->new_role - 1, "");
> fprintf(fp, "\n");
> }
> }
--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@tycho.nsa.gov with
the words "unsubscribe selinux" without quotes as the message.
next prev parent reply other threads:[~2011-03-28 21:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-25 5:51 v2 Add class support to the role_transition rule Harry Ciao
2011-03-25 5:51 ` [v2 PATCH 1/3] SELinux: Add class support to the role_trans structure Harry Ciao
2011-04-06 23:04 ` Eric Paris
2011-04-07 3:00 ` Harry Ciao
2011-03-25 5:51 ` [v2 PATCH 1/5] Userspace: add class to role_trans & role_trans_rule Harry Ciao
2011-03-25 5:51 ` [v2 PATCH 2/3] SELinux: Compute role in newcontext for all classes Harry Ciao
2011-03-25 5:51 ` [v2 PATCH 2/5] Userspace: role_transition parser to handle class field Harry Ciao
2011-03-25 5:52 ` [v2 PATCH 3/3] SELinux: Write class field in role_trans_write Harry Ciao
2011-03-25 16:50 ` Stephen Smalley
2011-03-28 18:30 ` Eric Paris
2011-03-25 5:52 ` [v2 PATCH 3/5] Userspace: handle the class field in role_trans struct Harry Ciao
2011-03-25 5:52 ` [v2 PATCH 4/5] Userspace: handle the class in role_trans_rule Harry Ciao
2011-03-25 5:52 ` [v2 PATCH 5/5] Userspace: display the class in role_transition rule Harry Ciao
2011-03-28 21:28 ` Joshua Brindle [this message]
2011-04-12 17:43 ` Daniel J Walsh
2011-04-12 18:03 ` Eric Paris
2011-04-12 13:31 ` v2 Add class support to the " Steve Lawrence
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D90FD99.90009@manicmethod.com \
--to=method@manicmethod.com \
--cc=eparis@parisplace.org \
--cc=jmorris@namei.org \
--cc=qingtao.cao@windriver.com \
--cc=sds@tycho.nsa.gov \
--cc=selinux@tycho.nsa.gov \
--cc=slawrence@tresys.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.