All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Brindle <jbrindle@tresys.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Paul Moore <paul.moore@hp.com>,
	selinux@tycho.nsa.gov, jkim@TrustedCS.com, chanson@TrustedCS.com,
	Daniel J Walsh <dwalsh@redhat.com>
Subject: Re: [PATCH] Fix the range_transition rule
Date: Mon, 08 Aug 2005 10:06:02 -0400	[thread overview]
Message-ID: <42F766CA.9070102@tresys.com> (raw)
In-Reply-To: <1123509256.13654.158.camel@moss-spartans.epoch.ncsc.mil>

Stephen Smalley wrote:

>On Sat, 2005-08-06 at 11:45 -0400, Joshua Brindle wrote:
>  
>
>>Thanks, however this should probably be using the typemap that already 
>>does this sort of thing.
>>something like new_range->type = state->typemap[type->value - 1] should 
>>work correctly.
>>    
>>
>
>How about this patch?
>
>Index: libsepol/src/expand.c
>===================================================================
>RCS file: /nfshome/pal/CVS/selinux-usr/libsepol/src/expand.c,v
>retrieving revision 1.2
>diff -u -p -r1.2 expand.c
>--- libsepol/src/expand.c	2 Aug 2005 18:32:15 -0000	1.2
>+++ libsepol/src/expand.c	8 Aug 2005 13:49:45 -0000
>@@ -1352,8 +1352,8 @@ static int range_trans_clone(expand_stat
>                 if ((new_range = malloc(sizeof(*new_range))) == NULL) {
>                         goto out_of_mem;
>                 }
>-                new_range->dom = range->dom;
>-                new_range->type = range->type;
>+                new_range->dom = state->typemap[range->dom-1];
>+                new_range->type = state->typemap[range->type-1];
>                 if (mls_level_clone(&new_range->range.level[0], &range->range.level[0]) == -1 ||
>                     mls_level_clone(&new_range->range.level[1], &range->range.level[1])) {
>                         goto out_of_mem;
>
>  
>
That looks correct.

--
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.

      reply	other threads:[~2005-08-08 14:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-05 20:27 [PATCH] Fix the range_transition rule Paul Moore
2005-08-06 15:45 ` Joshua Brindle
2005-08-08 13:54   ` Stephen Smalley
2005-08-08 14:06     ` Joshua Brindle [this message]

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=42F766CA.9070102@tresys.com \
    --to=jbrindle@tresys.com \
    --cc=chanson@TrustedCS.com \
    --cc=dwalsh@redhat.com \
    --cc=jkim@TrustedCS.com \
    --cc=paul.moore@hp.com \
    --cc=sds@tycho.nsa.gov \
    --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.