From: Harry Ciao <qingtao.cao@windriver.com>
To: Eric Paris <eparis@parisplace.org>
Cc: <selinux@tycho.nsa.gov>
Subject: Re: [v2 PATCH 6/8] Skip tunable identifier and cond_node_t in expansion.
Date: Thu, 8 Sep 2011 10:05:59 +0800 [thread overview]
Message-ID: <4E682307.8090004@windriver.com> (raw)
In-Reply-To: <CACLa4pvaMt+ty-A4KRq=neYQOeH5J2P9U_GLVLUzjcSrJ_i4yg@mail.gmail.com>
Thanks Eric for pointing this out! I would certainly fix the whitespace
errors in v3 patchset if that is desirable.
Thanks,
Harry
Eric Paris 写道:
> This patch contained a whitespace error. I have fixed it when
> applying to my queue branch. Please fix before resending if there is
> a need for a v3.
>
> -Eric
>
> On Wed, Aug 31, 2011 at 11:29 PM, Harry Ciao <qingtao.cao@windriver.com> wrote:
>
>> The effective branch of a tunable has been appended to its home
>> decl->avrules list during link, in expansion we should just skip tunables
>> from expanding their rules into te_cond_avtab hashtab and adding to the
>> out->cond_list queue.
>>
>> Signed-off-by: Harry Ciao <qingtao.cao@windriver.com>
>> ---
>> libsepol/src/expand.c | 13 +++++++++++++
>> 1 files changed, 13 insertions(+), 0 deletions(-)
>>
>> diff --git a/libsepol/src/expand.c b/libsepol/src/expand.c
>> index be41243..d5f10a6 100644
>> --- a/libsepol/src/expand.c
>> +++ b/libsepol/src/expand.c
>> @@ -1014,6 +1014,11 @@ static int bool_copy_callback(hashtab_key_t key, hashtab_datum_t datum,
>> return 0;
>> }
>>
>> + if (bool->flags & COND_BOOL_FLAGS_TUNABLE) {
>> + /* Skip tunables */
>> + return 0;
>> + }
>> +
>> if (state->verbose)
>> INFO(state->handle, "copying boolean %s", id);
>>
>> @@ -1046,6 +1051,7 @@ static int bool_copy_callback(hashtab_key_t key, hashtab_datum_t datum,
>> state->boolmap[bool->s.value - 1] = new_bool->s.value;
>>
>> new_bool->state = bool->state;
>> + new_bool->flags = bool->flags;
>>
>> return 0;
>> }
>> @@ -1940,6 +1946,13 @@ static int cond_node_copy(expand_state_t * state, cond_node_t * cn)
>> if (cond_node_copy(state, cn->next)) {
>> return -1;
>> }
>> +
>> + /* If current cond_node_t is of tunable, its effective branch
>> + * has been appended to its home decl->avrules list during link
>> + * and now we should just skip it. */
>> + if (cn->flags & COND_NODE_FLAGS_TUNABLE)
>> + return 0;
>> +
>> if (cond_normalize_expr(state->base, cn)) {
>> ERR(state->handle, "Error while normalizing conditional");
>> return -1;
>> --
>> 1.7.0.4
>>
>>
>> --
>> 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.
>>
>>
>
>
--
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-09-08 2:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-01 3:29 v2 Discard unused tunables from raw policy Harry Ciao
2011-09-01 3:29 ` [v2 PATCH 1/8] Indicate when boolean is indeed a tunable Harry Ciao
2011-09-01 3:29 ` [v2 PATCH 2/8] Separate tunable from boolean during compile Harry Ciao
2011-09-01 3:29 ` [v2 PATCH 3/8] Write and read TUNABLE flags in related data structures Harry Ciao
2011-09-07 21:47 ` Eric Paris
2011-09-08 8:28 ` HarryCiao
2011-09-01 3:29 ` [v2 PATCH 4/8] Copy and check the cond_bool_datum_t.flags during link Harry Ciao
2011-09-01 3:29 ` [v2 PATCH 5/8] Permanently discard disabled branches of tunables in expansion Harry Ciao
2011-09-01 3:29 ` [v2 PATCH 6/8] Skip tunable identifier and cond_node_t " Harry Ciao
2011-09-07 21:48 ` Eric Paris
2011-09-08 2:05 ` Harry Ciao [this message]
2011-09-01 3:29 ` [v2 PATCH 7/8] Create a new preserve_tunables flag in sepol_handle_t Harry Ciao
2011-09-01 3:29 ` [v2 PATCH 8/8] Preserve tunables when required by semodule program Harry Ciao
2011-09-08 18:06 ` v2 Discard unused tunables from raw policy Eric Paris
2011-09-09 1:28 ` Harry Ciao
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=4E682307.8090004@windriver.com \
--to=qingtao.cao@windriver.com \
--cc=eparis@parisplace.org \
--cc=selinux@tycho.nsa.gov \
/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.