Skip to contentSkip to conversation

mcstransd select correct colour range.

PATCH Applied Richard Haines 2 participants 2 messages Apr 10, 2011 – Apr 12, 2011 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mcstransd select correct colour range.

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.

---
 policycoreutils/mcstrans/src/mcscolor.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
policycoreutils/mcstrans/src/mcscolor.c +6 -6
index a443320..90c4321 100644
@@ -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;
 	}
Signature · 10 lines
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 [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw
Quoted 22 lines · Richard Haines

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.

---
 policycoreutils/mcstrans/src/mcscolor.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
policycoreutils/mcstrans/src/mcscolor.c +0 -5
index a443320..90c4321 100644
@@ -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)

policycoreutils/mcstrans/src/mcscolor.c static const secolor_t *find_color(int idx, const char *component, · line 146

Quoted 10 lines
policycoreutils/mcstrans/src/mcscolor.c +6 -1
-			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;
 	}

Applied to policycoreutils-2.0.86

Thanks!

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.