Blame SOURCES/bz1159289-aebc254a-Export-var_check-in-OVAL-object.patch

2f7d78
From aebc254a4e6993ef79a549c2f71b5a6a4eb3ed01 Mon Sep 17 00:00:00 2001
2f7d78
From: Martin Preisler <mpreisle@redhat.com>
2f7d78
Date: Mon, 3 Nov 2014 19:49:06 +0100
2f7d78
Subject: [PATCH] Export var_check in OVAL object when var_ref is present
2f7d78
2f7d78
Fixes validation issues with schematron, such as:
2f7d78
2f7d78
oval:mil.disa.fso.redhat.rhel6:obj:3184 - a var_ref has been supplied for the
2f7d78
ind-def:pattern entity so a var_check should also be provided
2f7d78
---
2f7d78
 src/OVAL/oval_objectContent.c | 4 +++-
2f7d78
 1 file changed, 3 insertions(+), 1 deletion(-)
2f7d78
2f7d78
diff --git a/src/OVAL/oval_objectContent.c b/src/OVAL/oval_objectContent.c
2f7d78
index ee59e86..eb59c25 100644
2f7d78
--- a/src/OVAL/oval_objectContent.c
2f7d78
+++ b/src/OVAL/oval_objectContent.c
2f7d78
@@ -403,7 +403,9 @@ xmlNode *oval_object_content_to_dom(struct oval_object_content *content, xmlDoc
2f7d78
 			struct oval_entity *entity = oval_object_content_get_entity(content);
2f7d78
 			content_node = oval_entity_to_dom(entity, doc, parent);
2f7d78
 			oval_check_t check = oval_object_content_get_varCheck(content);
2f7d78
-			if (check != OVAL_CHECK_ALL)
2f7d78
+			oval_entity_varref_type_t vtype = oval_entity_get_varref_type(entity);
2f7d78
+
2f7d78
+			if (check != OVAL_CHECK_ALL || vtype != OVAL_ENTITY_VARREF_NONE)
2f7d78
 				xmlNewProp(content_node, BAD_CAST "var_check", BAD_CAST oval_check_get_text(check));
2f7d78
 		}
2f7d78
 		break;
2f7d78
-- 
2f7d78
1.9.3
2f7d78