[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix the range_transition rule


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@xxxxxxxxxxxxx with
the words "unsubscribe selinux" without quotes as the message.


This mailing list archive is a service of Copilot Consulting.