a34c9ef
From f7b31b7e28a4f89bcfcd0d139cfca78777a4333e Mon Sep 17 00:00:00 2001
a34c9ef
From: Chris PeBenito <cpebenito@tresys.com>
a34c9ef
Date: Thu, 4 Feb 2016 14:06:49 -0500
a34c9ef
Subject: [PATCH] libqpol: Skip types when building type attribute map.
a34c9ef
a34c9ef
Fix originally from Richard Haines.
a34c9ef
a34c9ef
Closes #94.
a34c9ef
---
a34c9ef
 libqpol/src/policy_extend.c | 3 +++
a34c9ef
 1 file changed, 3 insertions(+)
a34c9ef
a34c9ef
diff --git a/libqpol/src/policy_extend.c b/libqpol/src/policy_extend.c
a34c9ef
index 1417271..416bddb 100644
a34c9ef
--- a/libqpol/src/policy_extend.c
a34c9ef
+++ b/libqpol/src/policy_extend.c
a34c9ef
@@ -201,6 +201,9 @@ static int qpol_policy_build_attrs_from_map(qpol_policy_t * policy)
a34c9ef
 	memset(&buff, 0, 10 * sizeof(char));
a34c9ef
 
a34c9ef
 	for (i = 0; i < db->p_types.nprim; i++) {
a34c9ef
+		/* skip types */
a34c9ef
+		if (db->type_val_to_struct[i]->flavor == TYPE_TYPE)
a34c9ef
+			continue;
a34c9ef
 		count = 0;
a34c9ef
 		ebitmap_for_each_bit(&db->attr_type_map[i], node, bit) {
a34c9ef
 			if (ebitmap_node_get_bit(node, bit))
a34c9ef
-- 
a34c9ef
2.5.0
a34c9ef