From fe17b3d2d924018750386c5ee74f12ca4b054136 Mon Sep 17 00:00:00 2001 From: Richard Haines Date: Sun, 10 Apr 2011 17:18:28 +0100 Subject: [PATCH] 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. Signed-off-by: Richard Haines Signed-off-by: Steve Lawrence --- policycoreutils/mcstrans/src/mcscolor.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/policycoreutils/mcstrans/src/mcscolor.c b/policycoreutils/mcstrans/src/mcscolor.c index a4433205..90c4321a 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; }