All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Haines <richard_c_haines@btinternet.com>
To: selinux@tycho.nsa.gov
Subject: [PATCH 1/1] mcstransd select correct colour range.
Date: Sun, 10 Apr 2011 17:18:28 +0100 (BST)	[thread overview]
Message-ID: <706242.2086.qm@web87005.mail.ird.yahoo.com> (raw)

mcstransd: Now selects the range color for a matching 'range' entry in secolor.conf file, and not the first range to pass the dominance check.

The second patch has the man pages to support the colour functions that match how mcstransd manages colour selection.

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
---
 policycoreutils/mcstrans/src/mcscolor.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/policycoreutils/mcstrans/src/mcscolor.c b/policycoreutils/mcstrans/src/mcscolor.c
index a443320..90c4321 100644
--- a/policycoreutils/mcstrans/src/mcscolor.c
+++ b/policycoreutils/mcstrans/src/mcscolor.c
@@ -135,12 +135,12 @@ static const secolor_t *find_color(int idx, const char *component,
 	}
 
 	while (ptr) {
-		if (idx == COLOR_RANGE) {
-		    if (check_dominance(ptr->pattern, raw) == 0)
-			return &ptr->color;
-		} else {
-		    if (fnmatch(ptr->pattern, component, 0) == 0)
-			return &ptr->color;
+		if (fnmatch(ptr->pattern, component, 0) == 0) {
+			if (idx == COLOR_RANGE) {
+			    if (check_dominance(ptr->pattern, raw) == 0)
+					return &ptr->color;
+			} else 
+				return &ptr->color;
 		}
 		ptr = ptr->next;
 	}
-- 
1.7.3.2


Richard


--
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:[~2011-04-10 16:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-10 16:18 Richard Haines [this message]
2011-04-12 13:26 ` [PATCH 1/1] mcstransd select correct colour range 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=706242.2086.qm@web87005.mail.ird.yahoo.com \
    --to=richard_c_haines@btinternet.com \
    --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.