Blame SOURCES/openscap-1.3.4-bump-yamlfilter-upgrade-probe-schemas-PR_1552.patch

cf6bdb
From b8dcde269fb97a021b44b2c54a823a50f3d8982c Mon Sep 17 00:00:00 2001
cf6bdb
From: Evgeny Kolesnikov <ekolesni@redhat.com>
cf6bdb
Date: Wed, 15 Jul 2020 14:46:06 +0200
cf6bdb
Subject: [PATCH 1/8] OVAL: Fix evaluation of field entries in records
cf6bdb
cf6bdb
Add proper evaluation implementation for operation, var_check
cf6bdb
and var_ref attributes in the field entry of a record.
cf6bdb
---
cf6bdb
 src/OVAL/results/oval_cmp.c        |  6 ----
cf6bdb
 src/OVAL/results/oval_cmp_impl.h   | 10 -------
cf6bdb
 src/OVAL/results/oval_resultTest.c | 44 +++++++++++++++++++-----------
cf6bdb
 3 files changed, 28 insertions(+), 32 deletions(-)
cf6bdb
cf6bdb
diff --git a/src/OVAL/results/oval_cmp.c b/src/OVAL/results/oval_cmp.c
cf6bdb
index 39e1f59e5..585332223 100644
cf6bdb
--- a/src/OVAL/results/oval_cmp.c
cf6bdb
+++ b/src/OVAL/results/oval_cmp.c
cf6bdb
@@ -161,9 +161,3 @@ oval_result_t oval_str_cmp_str(char *state_data, oval_datatype_t state_data_type
cf6bdb
 	oscap_seterr(OSCAP_EFAMILY_OVAL, "Invalid OVAL data type: %d.", state_data_type);
cf6bdb
 	return OVAL_RESULT_ERROR;
cf6bdb
 }
cf6bdb
-
cf6bdb
-oval_result_t oval_ent_cmp_str(char *state_data, oval_datatype_t state_data_type, struct oval_sysent *sysent, oval_operation_t operation)
cf6bdb
-{
cf6bdb
-	const char *sys_data = oval_sysent_get_value(sysent);
cf6bdb
-	return oval_str_cmp_str(state_data, state_data_type, sys_data, operation);
cf6bdb
-}
cf6bdb
diff --git a/src/OVAL/results/oval_cmp_impl.h b/src/OVAL/results/oval_cmp_impl.h
cf6bdb
index 4e38810f5..01014763b 100644
cf6bdb
--- a/src/OVAL/results/oval_cmp_impl.h
cf6bdb
+++ b/src/OVAL/results/oval_cmp_impl.h
cf6bdb
@@ -29,16 +29,6 @@
cf6bdb
 #include "oval_system_characteristics.h"
cf6bdb
 
cf6bdb
 
cf6bdb
-/**
cf6bdb
- * Compare state entity (or variable/value) to sysent object collected from system.
cf6bdb
- * This function does not support @datatype="record".
cf6bdb
- * @param state_value Value defined within state/entity/value or variable/value
cf6bdb
- * @param sysent Value collected from system
cf6bdb
- * @operation Comparison type operation
cf6bdb
- * @returns OVAL Result of comparison
cf6bdb
- */
cf6bdb
-oval_result_t oval_ent_cmp_str(char *state_data, oval_datatype_t state_data_type, struct oval_sysent *sysent, oval_operation_t operation);
cf6bdb
-
cf6bdb
 /**
cf6bdb
  * Compare state entity (or variable/value) to data collected from system.
cf6bdb
  * This function does not support @datatype="record".
cf6bdb
diff --git a/src/OVAL/results/oval_resultTest.c b/src/OVAL/results/oval_resultTest.c
cf6bdb
index b52b845ac..38477cb3b 100644
cf6bdb
--- a/src/OVAL/results/oval_resultTest.c
cf6bdb
+++ b/src/OVAL/results/oval_resultTest.c
cf6bdb
@@ -381,17 +381,11 @@ oval_result_t ores_get_result_byopr(struct oresults *ores, oval_operator_t op)
cf6bdb
 	return result;
cf6bdb
 }
cf6bdb
 
cf6bdb
-static inline oval_result_t _evaluate_sysent_with_variable(struct oval_syschar_model *syschar_model, struct oval_entity *state_entity, struct oval_sysent *item_entity, oval_operation_t state_entity_operation, struct oval_state_content *content)
cf6bdb
+static inline oval_result_t _evaluate_sysent_with_variable(struct oval_syschar_model *syschar_model, struct oval_variable *state_entity_var, const char *sys_data, oval_operation_t state_entity_operation, oval_check_t var_check)
cf6bdb
 {
cf6bdb
 	oval_syschar_collection_flag_t flag;
cf6bdb
 	oval_result_t ent_val_res;
cf6bdb
 
cf6bdb
-	struct oval_variable *state_entity_var;
cf6bdb
-	if ((state_entity_var = oval_entity_get_variable(state_entity)) == NULL) {
cf6bdb
-		oscap_seterr(OSCAP_EFAMILY_OVAL, "OVAL internal error: found NULL variable");
cf6bdb
-		return -1;
cf6bdb
-	}
cf6bdb
-
cf6bdb
 	if (0 != oval_syschar_model_compute_variable(syschar_model, state_entity_var)) {
cf6bdb
 		return -1;
cf6bdb
 	}
cf6bdb
@@ -420,16 +414,15 @@ static inline oval_result_t _evaluate_sysent_with_variable(struct oval_syschar_m
cf6bdb
 			}
cf6bdb
 			oval_datatype_t state_entity_val_datatype = oval_value_get_datatype(var_val);
cf6bdb
 
cf6bdb
-			var_val_res = oval_ent_cmp_str(state_entity_val_text, state_entity_val_datatype, item_entity, state_entity_operation);
cf6bdb
+			var_val_res = oval_str_cmp_str(state_entity_val_text, state_entity_val_datatype, sys_data, state_entity_operation);
cf6bdb
 			if (var_val_res == OVAL_RESULT_ERROR) {
cf6bdb
 				dE("Error occured when comparing a variable '%s' value '%s' with collected item entity = '%s'",
cf6bdb
-					oval_variable_get_id(state_entity_var), state_entity_val_text, oval_sysent_get_value(item_entity));
cf6bdb
+					oval_variable_get_id(state_entity_var), state_entity_val_text, sys_data);
cf6bdb
 			}
cf6bdb
 			ores_add_res(&var_ores, var_val_res);
cf6bdb
 		}
cf6bdb
 		oval_value_iterator_free(val_itr);
cf6bdb
 
cf6bdb
-		oval_check_t var_check = oval_state_content_get_var_check(content);
cf6bdb
 		ent_val_res = ores_get_result_bychk(&var_ores, var_check);
cf6bdb
 		} break;
cf6bdb
 	case SYSCHAR_FLAG_ERROR:
cf6bdb
@@ -450,6 +443,9 @@ struct record_field_instance {
cf6bdb
 	char *value;
cf6bdb
 	oval_datatype_t data_type;
cf6bdb
 	oval_check_t ent_check;
cf6bdb
+	oval_operation_t operation;
cf6bdb
+	struct oval_variable *var;
cf6bdb
+	oval_check_t var_check;
cf6bdb
 };
cf6bdb
 
cf6bdb
 static struct record_field_instance _oval_record_field_iterator_next_instance(struct oval_record_field_iterator *iterator)
cf6bdb
@@ -461,11 +457,14 @@ static struct record_field_instance _oval_record_field_iterator_next_instance(st
cf6bdb
 	instance.data_type = oval_record_field_get_datatype(rf);
cf6bdb
 	if (oval_record_field_get_type(rf) == OVAL_RECORD_FIELD_STATE) {
cf6bdb
 		instance.ent_check = oval_record_field_get_ent_check(rf);
cf6bdb
+		instance.operation = oval_record_field_get_operation(rf);
cf6bdb
 	}
cf6bdb
+	instance.var = oval_record_field_get_variable(rf);
cf6bdb
+	instance.var_check = oval_record_field_get_var_check(rf);
cf6bdb
 	return instance;
cf6bdb
 }
cf6bdb
 
cf6bdb
-static oval_result_t _evaluate_sysent_record(struct oval_state_content *state_content, struct oval_sysent *item_entity)
cf6bdb
+static oval_result_t _evaluate_sysent_record(struct oval_syschar_model *syschar_model, struct oval_state_content *state_content, struct oval_sysent *item_entity)
cf6bdb
 {
cf6bdb
 	struct oresults record_ores;
cf6bdb
 	ores_clear(&record_ores);
cf6bdb
@@ -485,7 +484,12 @@ static oval_result_t _evaluate_sysent_record(struct oval_state_content *state_co
cf6bdb
 			struct record_field_instance item_rf = _oval_record_field_iterator_next_instance(item_it);
cf6bdb
 			if (strcmp(state_rf.name, item_rf.name) == 0) {
cf6bdb
 				field_found = true;
cf6bdb
-				oval_result_t fields_comparison_result = oval_str_cmp_str(state_rf.value, state_rf.data_type, item_rf.value, OVAL_OPERATION_EQUALS);
cf6bdb
+				oval_result_t fields_comparison_result;
cf6bdb
+				if (state_rf.var != NULL) {
cf6bdb
+					fields_comparison_result = _evaluate_sysent_with_variable(syschar_model, state_rf.var, item_rf.value, state_rf.operation, state_rf.var_check);
cf6bdb
+				} else {
cf6bdb
+					fields_comparison_result = oval_str_cmp_str(state_rf.value, state_rf.data_type, item_rf.value, state_rf.operation);
cf6bdb
+				}
cf6bdb
 				ores_add_res(&field_ores, fields_comparison_result);
cf6bdb
 			}
cf6bdb
 		}
cf6bdb
@@ -510,10 +514,17 @@ static inline oval_result_t _evaluate_sysent(struct oval_syschar_model *syschar_
cf6bdb
 	if (oval_sysent_get_status(item_entity) == SYSCHAR_STATUS_DOES_NOT_EXIST) {
cf6bdb
 		return OVAL_RESULT_FALSE;
cf6bdb
 	} else if (oval_entity_get_varref_type(state_entity) == OVAL_ENTITY_VARREF_ATTRIBUTE) {
cf6bdb
+		struct oval_variable *state_entity_var;
cf6bdb
+		if ((state_entity_var = oval_entity_get_variable(state_entity)) == NULL) {
cf6bdb
+			oscap_seterr(OSCAP_EFAMILY_OVAL, "OVAL internal error: found NULL variable");
cf6bdb
+			return -1;
cf6bdb
+		}
cf6bdb
+		const char *sys_data = oval_sysent_get_value(item_entity);
cf6bdb
+		oval_check_t var_check = oval_state_content_get_var_check(content);
cf6bdb
 
cf6bdb
 		return _evaluate_sysent_with_variable(syschar_model,
cf6bdb
-				state_entity, item_entity,
cf6bdb
-				state_entity_operation, content);
cf6bdb
+				state_entity_var, sys_data,
cf6bdb
+				state_entity_operation, var_check);
cf6bdb
 	} else {
cf6bdb
 		struct oval_value *state_entity_val;
cf6bdb
 		char *state_entity_val_text;
cf6bdb
@@ -525,7 +536,7 @@ static inline oval_result_t _evaluate_sysent(struct oval_syschar_model *syschar_
cf6bdb
 				dE("The only allowed operation for comparing record types is 'equals'.");
cf6bdb
 				return OVAL_RESULT_ERROR;
cf6bdb
 			}
cf6bdb
-			return _evaluate_sysent_record(content, item_entity);
cf6bdb
+			return _evaluate_sysent_record(syschar_model, content, item_entity);
cf6bdb
 		} else {
cf6bdb
 			if ((state_entity_val = oval_entity_get_value(state_entity)) == NULL) {
cf6bdb
 				oscap_seterr(OSCAP_EFAMILY_OVAL, "OVAL internal error: found NULL entity value");
cf6bdb
@@ -537,7 +548,8 @@ static inline oval_result_t _evaluate_sysent(struct oval_syschar_model *syschar_
cf6bdb
 			}
cf6bdb
 			state_entity_val_datatype = oval_value_get_datatype(state_entity_val);
cf6bdb
 
cf6bdb
-			return oval_ent_cmp_str(state_entity_val_text, state_entity_val_datatype, item_entity, state_entity_operation);
cf6bdb
+			const char *sys_data = oval_sysent_get_value(item_entity);
cf6bdb
+			return oval_str_cmp_str(state_entity_val_text, state_entity_val_datatype, sys_data, state_entity_operation);
cf6bdb
 		}
cf6bdb
 	}
cf6bdb
 }
cf6bdb
cf6bdb
From 21d52f1eb56951be976674f318ecfd5359f282c6 Mon Sep 17 00:00:00 2001
cf6bdb
From: Evgeny Kolesnikov <ekolesni@redhat.com>
cf6bdb
Date: Thu, 25 Jun 2020 23:31:11 +0200
cf6bdb
Subject: [PATCH 2/8] probes/yamlfilecontent: Bump yaml-filter, extend the
cf6bdb
 schema and probe to be able to work with a set of values in maps
cf6bdb
cf6bdb
This introduces YAML Path selection ($.blah['key1','key2']) syntax and
cf6bdb
enriches yamlfilecontent test and schema with EntityStateRecordType and
cf6bdb
EntityItemRecordType result elements for collecting and checking
cf6bdb
complex objects in YAML/JSON documents.
cf6bdb
cf6bdb
This change also depend on removal of the 'only lower case' restriction
cf6bdb
from the name attribute of the field element (EntityXxxFieldType).
cf6bdb
---
cf6bdb
 .../5.11.3/independent-definitions-schema.xsd |  19 ++-
cf6bdb
 ...ependent-system-characteristics-schema.xsd |  13 +-
cf6bdb
 .../oval/5.11.3/oval-definitions-schema.xsd   |  14 +-
cf6bdb
 .../oval-system-characteristics-schema.xsd    |   7 +-
cf6bdb
 .../independent/yamlfilecontent_probe.c       | 155 ++++++++++++------
cf6bdb
 .../yamlfilecontent/openshift-logging.yaml    |  28 ++++
cf6bdb
 .../test_probes_yamlfilecontent_array.xml     |   8 +-
cf6bdb
 .../test_probes_yamlfilecontent_key.sh        |   2 +-
cf6bdb
 .../test_probes_yamlfilecontent_key.xml       |  70 +++++++-
cf6bdb
 ...st_probes_yamlfilecontent_offline_mode.xml |  12 +-
cf6bdb
 .../test_probes_yamlfilecontent_types.sh      |  40 ++---
cf6bdb
 yaml-filter                                   |   2 +-
cf6bdb
 12 files changed, 261 insertions(+), 109 deletions(-)
cf6bdb
cf6bdb
diff --git a/schemas/oval/5.11.3/independent-definitions-schema.xsd b/schemas/oval/5.11.3/independent-definitions-schema.xsd
cf6bdb
index 53e67e187..0f202abf6 100644
cf6bdb
--- a/schemas/oval/5.11.3/independent-definitions-schema.xsd
cf6bdb
+++ b/schemas/oval/5.11.3/independent-definitions-schema.xsd
cf6bdb
@@ -2115,7 +2115,7 @@
cf6bdb
                                                 </xsd:choice>
cf6bdb
                                                 <xsd:element name="yamlpath" type="oval-def:EntityObjectStringType">
cf6bdb
                                                       <xsd:annotation>
cf6bdb
-                                                            <xsd:documentation>Specifies an YAML Path expression to evaluate against the YAML file specified by the filename entity. This YAML Path expression must evaluate to a list of zero or more scalar values which will be accessible in OVAL via instances of the value_of entity. Any results from evaluating the YAML Path expression other than a list of scalar values (e.g., a hash or list of lists) is considered an error. The intention is that the scalar values be drawn from instances of a single, uniquely named element. However, an OVAL interpreter is not required to verify this, so the author should define the YAML Path expression carefully. Note that "equals" is the only valid operator for the yamlpath entity.</xsd:documentation>
cf6bdb
+                                                            <xsd:documentation>Specifies an YAML Path expression to evaluate against the YAML file specified by the filename entity. This YAML Path expression must evaluate to a list or a map (part of a map) of zero or more scalar values which will be accessible in OVAL via instances of the result entity. Any results from evaluating the YAML Path expression other than a list of scalar values (or a map with scalar values) at the bottom level (e.g. list of lists, list of maps, map with maps or lists) is considered an error, so the author should define the YAML Path expression carefully. Note that "equals" is the only valid operator for the yamlpath entity.</xsd:documentation>
cf6bdb
                                                             <xsd:appinfo>
cf6bdb
                                                                   <sch:pattern id="ind-def_yamlobjyamlpath">
cf6bdb
                                                                         <sch:rule context="ind-def:yamlfilecontent_object/ind-def:yamlpath">
cf6bdb
@@ -2158,13 +2158,24 @@
cf6bdb
                                     </xsd:element>
cf6bdb
                                     <xsd:element name="yamlpath" type="oval-def:EntityStateStringType" minOccurs="0" maxOccurs="1">
cf6bdb
                                           <xsd:annotation>
cf6bdb
-                                                <xsd:documentation>Specifies an YAML Path expression to evaluate against the YAML file specified by the filename entity. This YAML Path expression must evaluate to a list of zero or more text values which will be accessible in OVAL via instances of the value_of entity. Any results from evaluating the YAML Path expression other than a list of text strings (e.g., a nodes set) is considered an error. The intention is that the text values be drawn from instances of a single, uniquely named element or attribute. However, an OVAL interpreter is not required to verify this, so the author should define the YAML Path expression carefully. Note that "equals" is the only valid operator for the yamlpath entity.</xsd:documentation>
cf6bdb
+                                                <xsd:documentation>Specifies an YAML Path expression to evaluate against the YAML file specified by the filename entity. This YAML Path expression must evaluate to a list or a map (part of a map) of zero or more scalar values which will be accessible in OVAL via instances of the result entity. Any results from evaluating the YAML Path expression other than a list of scalar values (or a map with scalar values) at the bottom level (e.g. list of lists, list of maps, map with maps or lists) is considered an error, so the author should define the YAML Path expression carefully. Note that "equals" is the only valid operator for the yamlpath entity.</xsd:documentation>
cf6bdb
                                           </xsd:annotation>
cf6bdb
                                     </xsd:element>
cf6bdb
-                                    <xsd:element name="value_of" type="oval-def:EntityStateAnySimpleType" minOccurs="0" maxOccurs="1">
cf6bdb
+                                    <xsd:element name="value" type="oval-def:EntityStateRecordType" minOccurs="0">
cf6bdb
                                           <xsd:annotation>
cf6bdb
-                                                <xsd:documentation>The value_of element checks the value(s) of the text node(s) or attribute(s) found.</xsd:documentation>
cf6bdb
+                                                <xsd:documentation>The value entity specifies how to test objects in the value set of the specified YAML Path. To define tests for a signle scalar value or a list of scalar values, set name attribute of the field child element to an empty string (''). The check is entirely controlled by operator attributes of the field element.</xsd:documentation>
cf6bdb
+                                                <xsd:appinfo>
cf6bdb
+                                                      <sch:pattern id="ind-def_yamlfilestevalue">
cf6bdb
+                                                            <sch:rule context="ind-def:yamlfile_state/ind-def:value">
cf6bdb
+                                                                  <sch:assert test="@datatype='record'"><sch:value-of select="../@id"/> - datatype attribute for the value entity of a yamlfile_state must be 'record'</sch:assert>
cf6bdb
+                                                            </sch:rule>
cf6bdb
+                                                      </sch:pattern>
cf6bdb
+                                                </xsd:appinfo>
cf6bdb
                                           </xsd:annotation>
cf6bdb
+                                          <xsd:unique name="UniqueYamlFileResultFieldName">
cf6bdb
+                                                <xsd:selector xpath="./oval-def:field"/>
cf6bdb
+                                                <xsd:field xpath="@name"/>
cf6bdb
+                                          </xsd:unique>
cf6bdb
                                     </xsd:element>
cf6bdb
                                     <xsd:element name="windows_view" type="ind-def:EntityStateWindowsViewType" minOccurs="0">
cf6bdb
                                           <xsd:annotation>
cf6bdb
diff --git a/schemas/oval/5.11.3/independent-system-characteristics-schema.xsd b/schemas/oval/5.11.3/independent-system-characteristics-schema.xsd
cf6bdb
index 19c6a240e..b2934d4c6 100644
cf6bdb
--- a/schemas/oval/5.11.3/independent-system-characteristics-schema.xsd
cf6bdb
+++ b/schemas/oval/5.11.3/independent-system-characteristics-schema.xsd
cf6bdb
@@ -606,12 +606,19 @@
cf6bdb
                               </xsd:element>
cf6bdb
                               <xsd:element name="yamlpath" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
cf6bdb
                                    <xsd:annotation>
cf6bdb
-                                        <xsd:documentation>Specifies an YAML Path expression to evaluate against the YAML file specified by the filename entity. This YAML Path expression must evaluate to a list of zero or more scalar values which will be accessible in OVAL via instances of the value_of entity. Any results from evaluating the YAML Path expression other than a list of scalar values (e.g., a hash or list of lists) is considered an error. The intention is that the scalar values be drawn from instances of a single, uniquely named element. However, an OVAL interpreter is not required to verify this, so the author should define the YAML Path expression carefully. Note that "equals" is the only valid operator for the yamlpath entity.</xsd:documentation>
cf6bdb
+                                        <xsd:documentation>Specifies an YAML Path expression to evaluate against the YAML file specified by the filename entity. This YAML Path expression must evaluate to a list or a map (part of a map) of zero or more scalar values which will be accessible in OVAL via instances of the result entity. Any results from evaluating the YAML Path expression other than a list of scalar values (or a map with scalar values) at the bottom level (e.g. list of lists, list of maps, map with maps or lists) is considered an error, so the author should define the YAML Path expression carefully. Note that "equals" is the only valid operator for the yamlpath entity.</xsd:documentation>
cf6bdb
                                    </xsd:annotation>
cf6bdb
                               </xsd:element>
cf6bdb
-                              <xsd:element name="value_of" type="oval-sc:EntityItemAnySimpleType" minOccurs="0" maxOccurs="unbounded">
cf6bdb
+                              <xsd:element name="value" type="oval-sc:EntityItemRecordType" minOccurs="0" maxOccurs="unbounded">
cf6bdb
                                    <xsd:annotation>
cf6bdb
-                                        <xsd:documentation>The value_of element checks the value(s) of the text node(s) or attribute(s) found. How this is used is entirely controlled by operator attributes.</xsd:documentation>
cf6bdb
+                                        <xsd:documentation>The value entity holds the target(s) of the specified YAML Path. If YAML Path target is a signle scalar value or a list of scalar values, the field child element's name would be empty (''). The check is entirely controlled by operator attributes of the field element.</xsd:documentation>
cf6bdb
+                                        <xsd:appinfo>
cf6bdb
+                                             <sch:pattern id="ind-sc_yamlfile_itemvalue">
cf6bdb
+                                                  <sch:rule context="ind-sc:yamlfile_item/ind-sc:value">
cf6bdb
+                                                       <sch:assert test="@datatype='record'"><sch:value-of select="../@id"/> - datatype attribute for the value entity of a yamlfile_item must be 'record'</sch:assert>
cf6bdb
+                                                  </sch:rule>
cf6bdb
+                                             </sch:pattern>
cf6bdb
+                                        </xsd:appinfo>
cf6bdb
                                    </xsd:annotation>
cf6bdb
                               </xsd:element>
cf6bdb
                               <xsd:element name="windows_view" type="ind-sc:EntityItemWindowsViewType" minOccurs="0">
cf6bdb
diff --git a/schemas/oval/5.11.3/oval-definitions-schema.xsd b/schemas/oval/5.11.3/oval-definitions-schema.xsd
cf6bdb
index f43abd318..a57b889cf 100644
cf6bdb
--- a/schemas/oval/5.11.3/oval-definitions-schema.xsd
cf6bdb
+++ b/schemas/oval/5.11.3/oval-definitions-schema.xsd
cf6bdb
@@ -1553,13 +1553,8 @@
cf6bdb
             <xsd:extension base="xsd:anySimpleType">
cf6bdb
                 <xsd:attribute name="name" use="required">
cf6bdb
                     <xsd:annotation>
cf6bdb
-                        <xsd:documentation>A string restricted to disallow upper case characters.</xsd:documentation>
cf6bdb
+                        <xsd:documentation>A string.</xsd:documentation>
cf6bdb
                     </xsd:annotation>
cf6bdb
-                    <xsd:simpleType>
cf6bdb
-                        <xsd:restriction base="xsd:string">
cf6bdb
-                            <xsd:pattern value="[^A-Z]+"/>
cf6bdb
-                        </xsd:restriction>
cf6bdb
-                    </xsd:simpleType>
cf6bdb
                 </xsd:attribute>
cf6bdb
                 <xsd:attributeGroup ref="oval-def:EntityAttributeGroup"/>
cf6bdb
                 <xsd:attribute name="entity_check" type="oval:CheckEnumeration" use="optional" default="all"/>
cf6bdb
@@ -1824,13 +1819,8 @@
cf6bdb
             <xsd:extension base="xsd:anySimpleType">
cf6bdb
                 <xsd:attribute name="name" use="required">
cf6bdb
                     <xsd:annotation>
cf6bdb
-                        <xsd:documentation>A string restricted to disallow upper case characters.</xsd:documentation>
cf6bdb
+                        <xsd:documentation>A string.</xsd:documentation>
cf6bdb
                     </xsd:annotation>
cf6bdb
-                    <xsd:simpleType>
cf6bdb
-                        <xsd:restriction base="xsd:string">
cf6bdb
-                            <xsd:pattern value="[^A-Z]+"/>
cf6bdb
-                        </xsd:restriction>
cf6bdb
-                    </xsd:simpleType>
cf6bdb
                 </xsd:attribute>
cf6bdb
                 <xsd:attributeGroup ref="oval-def:EntityAttributeGroup"/>
cf6bdb
                 <xsd:attribute name="entity_check" type="oval:CheckEnumeration" use="optional" default="all"/>
cf6bdb
diff --git a/schemas/oval/5.11.3/oval-system-characteristics-schema.xsd b/schemas/oval/5.11.3/oval-system-characteristics-schema.xsd
cf6bdb
index 30962f330..543b2db71 100644
cf6bdb
--- a/schemas/oval/5.11.3/oval-system-characteristics-schema.xsd
cf6bdb
+++ b/schemas/oval/5.11.3/oval-system-characteristics-schema.xsd
cf6bdb
@@ -574,13 +574,8 @@
cf6bdb
             <xsd:extension base="xsd:anySimpleType">
cf6bdb
                 <xsd:attribute name="name" use="required">
cf6bdb
                     <xsd:annotation>
cf6bdb
-                        <xsd:documentation>A string restricted to disallow upper case characters.</xsd:documentation>
cf6bdb
+                        <xsd:documentation>A string.</xsd:documentation>
cf6bdb
                     </xsd:annotation>
cf6bdb
-                    <xsd:simpleType>
cf6bdb
-                        <xsd:restriction base="xsd:string">
cf6bdb
-                            <xsd:pattern value="[^A-Z]+"/>
cf6bdb
-                        </xsd:restriction>
cf6bdb
-                    </xsd:simpleType>
cf6bdb
                 </xsd:attribute>
cf6bdb
                 <xsd:attributeGroup ref="oval-sc:EntityAttributeGroup"/>
cf6bdb
             </xsd:extension>
cf6bdb
diff --git a/src/OVAL/probes/independent/yamlfilecontent_probe.c b/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
index 66d08ad22..f7c7d08cb 100644
cf6bdb
--- a/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
+++ b/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
@@ -73,7 +73,7 @@ static SEXP_t *yaml_scalar_event_to_sexp(yaml_event_t *event)
cf6bdb
 	char *tag = (char *) event->data.scalar.tag;
cf6bdb
 	char *value = (char *) event->data.scalar.value;
cf6bdb
 
cf6bdb
-	/* nodes lacking an explicit tag are given a non-specific tag:
cf6bdb
+	/* Nodes lacking an explicit tag are given a non-specific tag:
cf6bdb
 	 * “!” for non-plain scalars, and “?” for all other nodes
cf6bdb
 	 */
cf6bdb
 	if (tag == NULL) {
cf6bdb
@@ -139,30 +139,30 @@ static SEXP_t *yaml_scalar_event_to_sexp(yaml_event_t *event)
cf6bdb
 	return SEXP_string_new(value, strlen(value));
cf6bdb
 }
cf6bdb
 
cf6bdb
+#define result_error(fmt, args...)                                       \
cf6bdb
+do {                                                                     \
cf6bdb
+	SEXP_t *msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR, fmt, args); \
cf6bdb
+	probe_cobj_add_msg(probe_ctx_getresult(ctx), msg);                   \
cf6bdb
+	SEXP_free(msg);                                                      \
cf6bdb
+	probe_cobj_set_flag(probe_ctx_getresult(ctx), SYSCHAR_FLAG_ERROR);   \
cf6bdb
+	ret = -1;                                                            \
cf6bdb
+} while (0)
cf6bdb
+
cf6bdb
 static int yaml_path_query(const char *filepath, const char *yaml_path_cstr, struct oscap_list *values, probe_ctx *ctx)
cf6bdb
 {
cf6bdb
 	int ret = 0;
cf6bdb
 	FILE *yaml_file = fopen(filepath, "r");
cf6bdb
 	if (yaml_file == NULL) {
cf6bdb
-		SEXP_t *msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR,
cf6bdb
-			"Unable to open file '%s': %s", filepath, strerror(errno));
cf6bdb
-		probe_cobj_add_msg(probe_ctx_getresult(ctx), msg);
cf6bdb
-		SEXP_free(msg);
cf6bdb
-		probe_cobj_set_flag(probe_ctx_getresult(ctx), SYSCHAR_FLAG_ERROR);
cf6bdb
-		return -1;
cf6bdb
+		result_error("Unable to open file '%s': %s", filepath, strerror(errno));
cf6bdb
+		return ret;
cf6bdb
 	}
cf6bdb
 
cf6bdb
 	yaml_path_t *yaml_path = yaml_path_create();
cf6bdb
 	if (yaml_path_parse(yaml_path, (char *) yaml_path_cstr)) {
cf6bdb
-		SEXP_t *msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR,
cf6bdb
-			"Invalid YAML path '%s' (%s)\n", yaml_path_cstr,
cf6bdb
-			yaml_path_error_get(yaml_path)->message);
cf6bdb
-		probe_cobj_add_msg(probe_ctx_getresult(ctx), msg);
cf6bdb
-		SEXP_free(msg);
cf6bdb
-		probe_cobj_set_flag(probe_ctx_getresult(ctx), SYSCHAR_FLAG_ERROR);
cf6bdb
+		result_error("Invalid YAML path '%s': %s", yaml_path_cstr, yaml_path_error_get(yaml_path)->message);
cf6bdb
 		yaml_path_destroy(yaml_path);
cf6bdb
 		fclose(yaml_file);
cf6bdb
-		return -1;
cf6bdb
+		return ret;
cf6bdb
 	};
cf6bdb
 
cf6bdb
 	yaml_parser_t parser;
cf6bdb
@@ -172,71 +172,94 @@ static int yaml_path_query(const char *filepath, const char *yaml_path_cstr, str
cf6bdb
 	yaml_event_t event;
cf6bdb
 	yaml_event_type_t event_type;
cf6bdb
 	bool sequence = false;
cf6bdb
+	bool mapping = false;
cf6bdb
+	int index = 0;
cf6bdb
+	char *key = strdup("");
cf6bdb
+
cf6bdb
+	struct oscap_htable *record = NULL;
cf6bdb
 
cf6bdb
 	do {
cf6bdb
 		if (!yaml_parser_parse(&parser, &event)) {
cf6bdb
-			SEXP_t *msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR,
cf6bdb
-				"YAML parser error: yaml_parse_parse returned 0: %s",
cf6bdb
-				parser.problem);
cf6bdb
-			probe_cobj_add_msg(probe_ctx_getresult(ctx), msg);
cf6bdb
-			SEXP_free(msg);
cf6bdb
-			probe_cobj_set_flag(probe_ctx_getresult(ctx), SYSCHAR_FLAG_ERROR);
cf6bdb
-			ret = -1;
cf6bdb
+			result_error("YAML parser error: %s", parser.problem);
cf6bdb
 			goto cleanup;
cf6bdb
 		}
cf6bdb
-
cf6bdb
-		event_type = event.type;
cf6bdb
 		if (!yaml_path_filter_event(yaml_path, &parser, &event,
cf6bdb
 				YAML_PATH_FILTER_RETURN_ALL)) {
cf6bdb
 			goto next;
cf6bdb
 		}
cf6bdb
+
cf6bdb
+		event_type = event.type;
cf6bdb
+
cf6bdb
 		if (sequence) {
cf6bdb
 			if (event_type == YAML_SEQUENCE_END_EVENT) {
cf6bdb
 				sequence = false;
cf6bdb
-			} else if (event_type != YAML_SCALAR_EVENT) {
cf6bdb
-				SEXP_t *msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR,
cf6bdb
-					"YAML path '%s' contains non-scalar in a sequence.",
cf6bdb
-					yaml_path_cstr);
cf6bdb
-				probe_cobj_add_msg(probe_ctx_getresult(ctx), msg);
cf6bdb
-				SEXP_free(msg);
cf6bdb
-				probe_cobj_set_flag(probe_ctx_getresult(ctx), SYSCHAR_FLAG_ERROR);
cf6bdb
-				ret = -1;
cf6bdb
+			} else if (event_type == YAML_SEQUENCE_START_EVENT) {
cf6bdb
+				result_error("YAML path '%s' points to a multi-dimensional structure", yaml_path_cstr);
cf6bdb
 				goto cleanup;
cf6bdb
 			}
cf6bdb
 		} else {
cf6bdb
 			if (event_type == YAML_SEQUENCE_START_EVENT) {
cf6bdb
 				sequence = true;
cf6bdb
 			}
cf6bdb
-			if (event_type == YAML_MAPPING_START_EVENT) {
cf6bdb
-				SEXP_t *msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR,
cf6bdb
-					"YAML path '%s' matches a mapping.",
cf6bdb
-					yaml_path_cstr);
cf6bdb
-				probe_cobj_add_msg(probe_ctx_getresult(ctx), msg);
cf6bdb
-				SEXP_free(msg);
cf6bdb
-				probe_cobj_set_flag(probe_ctx_getresult(ctx), SYSCHAR_FLAG_ERROR);
cf6bdb
-				ret = -1;
cf6bdb
+		}
cf6bdb
+
cf6bdb
+		if (mapping) {
cf6bdb
+			if (event_type == YAML_MAPPING_END_EVENT) {
cf6bdb
+				mapping = false;
cf6bdb
+				oscap_list_add(values, record);
cf6bdb
+				record = NULL;
cf6bdb
+			} else if (event_type == YAML_MAPPING_START_EVENT) {
cf6bdb
+				result_error("YAML path '%s' points to a multi-dimensional structure", yaml_path_cstr);
cf6bdb
 				goto cleanup;
cf6bdb
 			}
cf6bdb
+		} else {
cf6bdb
+			if (event_type == YAML_MAPPING_START_EVENT) {
cf6bdb
+				if (record) {
cf6bdb
+					result_error("YAML path '%s' points to a multi-dimensional structure", yaml_path_cstr);
cf6bdb
+					goto cleanup;
cf6bdb
+				}
cf6bdb
+				mapping = true;
cf6bdb
+				sequence = false;
cf6bdb
+				index = 0;
cf6bdb
+				record = oscap_htable_new();
cf6bdb
+			}
cf6bdb
 		}
cf6bdb
+
cf6bdb
 		if (event_type == YAML_SCALAR_EVENT) {
cf6bdb
+			if (mapping) {
cf6bdb
+				if (!sequence) {
cf6bdb
+					if (index++ % 2 == 0) {
cf6bdb
+						free(key);
cf6bdb
+						key = strdup((const char *) event.data.scalar.value);
cf6bdb
+						goto next;
cf6bdb
+					}
cf6bdb
+				}
cf6bdb
+			}
cf6bdb
+
cf6bdb
 			SEXP_t *sexp = yaml_scalar_event_to_sexp(&event);
cf6bdb
 			if (sexp == NULL) {
cf6bdb
-				SEXP_t *msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR,
cf6bdb
-					"Can't convert '%s %s' to SEXP", event.data.scalar.tag,
cf6bdb
-					event.data.scalar.value);
cf6bdb
-				probe_cobj_add_msg(probe_ctx_getresult(ctx), msg);
cf6bdb
-				SEXP_free(msg);
cf6bdb
-				probe_cobj_set_flag(probe_ctx_getresult(ctx), SYSCHAR_FLAG_ERROR);
cf6bdb
-				ret = -1;
cf6bdb
+				result_error("Can't convert '%s %s' to SEXP", event.data.scalar.tag, event.data.scalar.value);
cf6bdb
 				goto cleanup;
cf6bdb
 			}
cf6bdb
-			oscap_list_add(values, sexp);
cf6bdb
+
cf6bdb
+			if (!record)
cf6bdb
+				record = oscap_htable_new();
cf6bdb
+			struct oscap_list *field = oscap_htable_get(record, key);
cf6bdb
+			if (!field) {
cf6bdb
+				field = oscap_list_new();
cf6bdb
+				oscap_htable_add(record, key, field);
cf6bdb
+			}
cf6bdb
+
cf6bdb
+			oscap_list_add(field, sexp);
cf6bdb
 		}
cf6bdb
 next:
cf6bdb
 		yaml_event_delete(&event);
cf6bdb
 	} while (event_type != YAML_STREAM_END_EVENT);
cf6bdb
 
cf6bdb
 cleanup:
cf6bdb
+	if (record)
cf6bdb
+		oscap_list_add(values, record);
cf6bdb
+	free(key);
cf6bdb
 	yaml_parser_delete(&parser);
cf6bdb
 	yaml_path_destroy(yaml_path);
cf6bdb
 	fclose(yaml_file);
cf6bdb
@@ -244,6 +267,16 @@ static int yaml_path_query(const char *filepath, const char *yaml_path_cstr, str
cf6bdb
 	return ret;
cf6bdb
 }
cf6bdb
 
cf6bdb
+static void record_free(struct oscap_list *items)
cf6bdb
+{
cf6bdb
+	oscap_list_free(items, (oscap_destruct_func) SEXP_free);
cf6bdb
+}
cf6bdb
+
cf6bdb
+static void values_free(struct oscap_htable *record)
cf6bdb
+{
cf6bdb
+	oscap_htable_free(record, (oscap_destruct_func) record_free);
cf6bdb
+}
cf6bdb
+
cf6bdb
 static int process_yaml_file(const char *prefix, const char *path, const char *filename, const char *yamlpath, probe_ctx *ctx)
cf6bdb
 {
cf6bdb
 	int ret = 0;
cf6bdb
@@ -265,21 +298,37 @@ static int process_yaml_file(const char *prefix, const char *path, const char *f
cf6bdb
 			"path", OVAL_DATATYPE_STRING, path,
cf6bdb
 			"filename", OVAL_DATATYPE_STRING, filename,
cf6bdb
 			"yamlpath", OVAL_DATATYPE_STRING, yamlpath,
cf6bdb
-			/*
cf6bdb
-			"windows_view",
cf6bdb
-			*/
cf6bdb
+			// TODO: Implement "windows_view",
cf6bdb
 			NULL
cf6bdb
 		);
cf6bdb
 		while (oscap_iterator_has_more(values_it)) {
cf6bdb
-			SEXP_t *value_sexp = oscap_iterator_next(values_it);
cf6bdb
-			probe_item_ent_add(item, "value_of", NULL, value_sexp);
cf6bdb
+			SEXP_t *result_ent = probe_ent_creat1("value", NULL, NULL);
cf6bdb
+			probe_ent_setdatatype(result_ent, OVAL_DATATYPE_RECORD);
cf6bdb
+			struct oscap_htable *record = oscap_iterator_next(values_it);
cf6bdb
+			struct oscap_htable_iterator *record_it = oscap_htable_iterator_new(record);
cf6bdb
+			while(oscap_htable_iterator_has_more(record_it)) {
cf6bdb
+				const struct oscap_htable_item *record_item = oscap_htable_iterator_next(record_it);
cf6bdb
+				struct oscap_iterator *item_value_it = oscap_iterator_new(record_item->value);
cf6bdb
+				SEXP_t se_tmp_mem;
cf6bdb
+				SEXP_t *key = SEXP_string_new_r(&se_tmp_mem, record_item->key, strlen(record_item->key));
cf6bdb
+				while(oscap_iterator_has_more(item_value_it)) {
cf6bdb
+					SEXP_t *value_sexp = oscap_iterator_next(item_value_it);
cf6bdb
+					SEXP_t *field = probe_ent_creat1("field", NULL, value_sexp);
cf6bdb
+					probe_item_attr_add(field, "name", key);
cf6bdb
+					SEXP_list_add(result_ent, field);
cf6bdb
+				}
cf6bdb
+				oscap_iterator_free(item_value_it);
cf6bdb
+				SEXP_free_r(&se_tmp_mem);
cf6bdb
+			}
cf6bdb
+			oscap_htable_iterator_free(record_it);
cf6bdb
+			SEXP_list_add(item, result_ent);
cf6bdb
 		}
cf6bdb
 		probe_item_collect(ctx, item);
cf6bdb
 	}
cf6bdb
 	oscap_iterator_free(values_it);
cf6bdb
 
cf6bdb
 cleanup:
cf6bdb
-	oscap_list_free(values, (oscap_destruct_func) SEXP_free);
cf6bdb
+	oscap_list_free(values, (oscap_destruct_func) values_free);
cf6bdb
 	free(filepath_with_prefix);
cf6bdb
 	free(filepath);
cf6bdb
 	return ret;
cf6bdb
diff --git a/tests/probes/yamlfilecontent/openshift-logging.yaml b/tests/probes/yamlfilecontent/openshift-logging.yaml
cf6bdb
index a89e70942..fb6a9d8b6 100644
cf6bdb
--- a/tests/probes/yamlfilecontent/openshift-logging.yaml
cf6bdb
+++ b/tests/probes/yamlfilecontent/openshift-logging.yaml
cf6bdb
@@ -38,3 +38,31 @@ spec:
cf6bdb
      inputSource: logs.audit
cf6bdb
      outputRefs:
cf6bdb
      - secureforward-offcluster
cf6bdb
+status:
cf6bdb
+  conditions:
cf6bdb
+  - lastTransitionTime: "2020-06-08T04:54:58Z"
cf6bdb
+    reason: AsExpected
cf6bdb
+    status: "False"
cf6bdb
+    type: Degraded
cf6bdb
+  - lastTransitionTime: "2020-06-08T06:34:00Z"
cf6bdb
+    reason: AsExpected
cf6bdb
+    status: "False"
cf6bdb
+    type: Progressing
cf6bdb
+  - lastTransitionTime: "2020-06-08T04:51:08Z"
cf6bdb
+    reason: AsExpected
cf6bdb
+    status: "True"
cf6bdb
+    type: Available
cf6bdb
+  - lastTransitionTime: "2020-06-08T04:45:45Z"
cf6bdb
+    reason: AsExpected
cf6bdb
+    status: "True"
cf6bdb
+    type: Upgradeable
cf6bdb
+  extension: null
cf6bdb
+  relatedObjects:
cf6bdb
+  - group: operator.openshift.io
cf6bdb
+    name: cluster
cf6bdb
+    resource: openshiftapiservers
cf6bdb
+  versions:
cf6bdb
+  - name: operator
cf6bdb
+    version: 4.5.0-0.nightly-2020-06-04-214605
cf6bdb
+  - name: openshift-apiserver
cf6bdb
+    version: 4.5.0-0.nightly-2020-06-04-214605
cf6bdb
diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.xml b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.xml
cf6bdb
index 768b0b4a3..9a4227fb8 100644
cf6bdb
--- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.xml
cf6bdb
+++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.xml
cf6bdb
@@ -76,11 +76,15 @@
cf6bdb
   <states>
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:1">
cf6bdb
-      <ind-def:value_of datatype="string">secureforward-offcluster</ind-def:value_of>
cf6bdb
+      <ind-def:value datatype="record">
cf6bdb
+        <field name="" datatype="string">secureforward-offcluster</field>
cf6bdb
+      </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:2">
cf6bdb
-      <ind-def:value_of datatype="string" var_ref="oval:0:var:2" var_check="at least one" />
cf6bdb
+      <ind-def:value datatype="record">
cf6bdb
+        <field name="" datatype="string" var_ref="oval:0:var:2" var_check="at least one" entity_check="at least one"/>
cf6bdb
+      </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
   </states>
cf6bdb
diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh
cf6bdb
index 300c1b496..b25ad99f9 100755
cf6bdb
--- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh
cf6bdb
+++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh
cf6bdb
@@ -19,7 +19,7 @@ function test_probes_yamlfilecontent_key {
cf6bdb
     $OSCAP oval eval --results $RF $DF
cf6bdb
 
cf6bdb
     if [ -f $RF ]; then
cf6bdb
-        verify_results "def" $DF $RF 3 && verify_results "tst" $DF $RF 4
cf6bdb
+        verify_results "def" $DF $RF 5 && verify_results "tst" $DF $RF 6
cf6bdb
         ret_val=$?
cf6bdb
     else
cf6bdb
         ret_val=1
cf6bdb
diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml
cf6bdb
index f055bb648..fc3ee939e 100644
cf6bdb
--- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml
cf6bdb
+++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml
cf6bdb
@@ -21,7 +21,7 @@
cf6bdb
       </criteria>
cf6bdb
     </definition>
cf6bdb
 
cf6bdb
-    <definition class="compliance" version="1" id="oval:0:def:2"> 
cf6bdb
+    <definition class="compliance" version="1" id="oval:0:def:2"> 
cf6bdb
       <metadata>
cf6bdb
         <title></title>
cf6bdb
         <description></description>
cf6bdb
@@ -41,6 +41,26 @@
cf6bdb
       </criteria>
cf6bdb
     </definition>
cf6bdb
 
cf6bdb
+    <definition class="compliance" version="1" id="oval:0:def:4"> 
cf6bdb
+      <metadata>
cf6bdb
+        <title></title>
cf6bdb
+        <description></description>
cf6bdb
+      </metadata>
cf6bdb
+      <criteria operator="AND">
cf6bdb
+        <criterion comment="multiple_mapping_values" test_ref="oval:0:tst:5"/>
cf6bdb
+      </criteria>
cf6bdb
+    </definition>
cf6bdb
+
cf6bdb
+    <definition class="compliance" version="1" id="oval:0:def:5"> 
cf6bdb
+      <metadata>
cf6bdb
+        <title></title>
cf6bdb
+        <description></description>
cf6bdb
+      </metadata>
cf6bdb
+      <criteria operator="AND">
cf6bdb
+        <criterion comment="map_target" test_ref="oval:0:tst:6"/>
cf6bdb
+      </criteria>
cf6bdb
+    </definition>
cf6bdb
+
cf6bdb
   </definitions>
cf6bdb
 
cf6bdb
   <tests>
cf6bdb
@@ -55,7 +75,7 @@
cf6bdb
       <ind-def:state state_ref="oval:0:ste:2"/>
cf6bdb
     </ind-def:yamlfilecontent_test>
cf6bdb
 
cf6bdb
-    <ind-def:yamlfilecontent_test version="1" id="oval:0:tst:3" check="all" comment="error">
cf6bdb
+    <ind-def:yamlfilecontent_test version="1" id="oval:0:tst:3" check="all" comment="true">
cf6bdb
       <ind-def:object object_ref="oval:0:obj:3"/>
cf6bdb
     </ind-def:yamlfilecontent_test>
cf6bdb
 
cf6bdb
@@ -63,6 +83,16 @@
cf6bdb
       <ind-def:object object_ref="oval:0:obj:4"/>
cf6bdb
     </ind-def:yamlfilecontent_test>
cf6bdb
 
cf6bdb
+    <ind-def:yamlfilecontent_test version="1" id="oval:0:tst:5" check="all" comment="true">
cf6bdb
+      <ind-def:object object_ref="oval:0:obj:5"/>
cf6bdb
+      <ind-def:state state_ref="oval:0:ste:5"/>
cf6bdb
+    </ind-def:yamlfilecontent_test>
cf6bdb
+
cf6bdb
+    <ind-def:yamlfilecontent_test version="1" id="oval:0:tst:6" check="all" comment="true">
cf6bdb
+      <ind-def:object object_ref="oval:0:obj:6"/>
cf6bdb
+      <ind-def:state state_ref="oval:0:ste:6"/>
cf6bdb
+    </ind-def:yamlfilecontent_test>
cf6bdb
+
cf6bdb
   </tests>
cf6bdb
 
cf6bdb
   <objects>
cf6bdb
@@ -91,16 +121,48 @@
cf6bdb
       <ind-def:yamlpath>.doesnt.exist</ind-def:yamlpath>
cf6bdb
     </ind-def:yamlfilecontent_object>
cf6bdb
 
cf6bdb
+    <ind-def:yamlfilecontent_object version="1" id="oval:0:obj:5">
cf6bdb
+      <ind-def:path>/tmp</ind-def:path>
cf6bdb
+      <ind-def:filename>openshift-logging.yaml</ind-def:filename>
cf6bdb
+      <ind-def:yamlpath>.status.conditions[:]['status','type']</ind-def:yamlpath>
cf6bdb
+    </ind-def:yamlfilecontent_object>
cf6bdb
+
cf6bdb
+    <ind-def:yamlfilecontent_object version="1" id="oval:0:obj:6">
cf6bdb
+      <ind-def:path>/tmp</ind-def:path>
cf6bdb
+      <ind-def:filename>openshift-logging.yaml</ind-def:filename>
cf6bdb
+      <ind-def:yamlpath>.status.conditions[:]</ind-def:yamlpath>
cf6bdb
+    </ind-def:yamlfilecontent_object>
cf6bdb
+
cf6bdb
   </objects>
cf6bdb
 
cf6bdb
   <states>
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:1">
cf6bdb
-      <ind-def:value_of datatype="string">LogForwarding</ind-def:value_of>
cf6bdb
+      <ind-def:value datatype="record">
cf6bdb
+        <field name="" datatype="string">LogForwarding</field>
cf6bdb
+      </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:2">
cf6bdb
-      <ind-def:value_of datatype="string">openshift-logging</ind-def:value_of>
cf6bdb
+      <ind-def:value datatype="record">
cf6bdb
+        <field name="" datatype="string">openshift-logging</field>
cf6bdb
+      </ind-def:value>
cf6bdb
+    </ind-def:yamlfilecontent_state>
cf6bdb
+
cf6bdb
+    <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:5">
cf6bdb
+      <ind-def:value datatype="record" entity_check="at least one">
cf6bdb
+        <field name="status" datatype="string">True</field>
cf6bdb
+        <field name="type" datatype="string">Upgradeable</field>
cf6bdb
+      </ind-def:value>
cf6bdb
+    </ind-def:yamlfilecontent_state>
cf6bdb
+
cf6bdb
+    <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:6">
cf6bdb
+      <ind-def:value datatype="record" entity_check="at least one">
cf6bdb
+        <field name="status" datatype="string">True</field>
cf6bdb
+        <field name="reason" datatype="string">AsExpected</field>
cf6bdb
+        <field name="type" datatype="string">Upgradeable</field>
cf6bdb
+        <field name="lastTransitionTime" datatype="string" operation="pattern match">^\d+-\d+-.*Z$</field>
cf6bdb
+      </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
   </states>
cf6bdb
diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.xml b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.xml
cf6bdb
index 675f528e8..5c7cf5b28 100644
cf6bdb
--- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.xml
cf6bdb
+++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.xml
cf6bdb
@@ -85,15 +85,21 @@
cf6bdb
   <states>
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:1">
cf6bdb
-      <ind-def:value_of datatype="string">instance</ind-def:value_of>
cf6bdb
+      <ind-def:value datatype="record">
cf6bdb
+        <field name="" datatype="string">instance</field>
cf6bdb
+      </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:2">
cf6bdb
-      <ind-def:value_of datatype="string">outstance</ind-def:value_of>
cf6bdb
+      <ind-def:value datatype="record">
cf6bdb
+        <field name="" datatype="string">outstance</field>
cf6bdb
+      </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:3">
cf6bdb
-      <ind-def:value_of datatype="string">instance</ind-def:value_of>
cf6bdb
+      <ind-def:value datatype="record">
cf6bdb
+        <field name="" datatype="string">instance</field>
cf6bdb
+      </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
   </states>
cf6bdb
diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh
cf6bdb
index 97bb33dfd..8b0614fc6 100755
cf6bdb
--- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh
cf6bdb
+++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh
cf6bdb
@@ -24,49 +24,49 @@ function test_probes_yamlfilecontent_types {
cf6bdb
 
cf6bdb
     sd='/oval_results/results/system/oval_system_characteristics/system_data'
cf6bdb
 
cf6bdb
-    assert_exists 8 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="boolean"]'
cf6bdb
-    assert_exists 4 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="boolean" and text()="true"]'
cf6bdb
-    assert_exists 4 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="boolean" and text()="false"]'
cf6bdb
+    assert_exists 8 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="boolean"]'
cf6bdb
+    assert_exists 4 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="boolean" and text()="true"]'
cf6bdb
+    assert_exists 4 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="boolean" and text()="false"]'
cf6bdb
 
cf6bdb
-    assert_exists 5 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="int"]'
cf6bdb
+    assert_exists 5 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="int"]'
cf6bdb
     # int_10: 42
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="int" and text()="42"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="int" and text()="42"]'
cf6bdb
     # int_10_neg: -17
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="int" and text()="-17"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="int" and text()="-17"]'
cf6bdb
     # int_8: 0o33
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="int" and text()="27"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="int" and text()="27"]'
cf6bdb
     # int_16: 0xFF
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="int" and text()="255"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="int" and text()="255"]'
cf6bdb
     # int_cast: !!int "369"
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="int" and text()="369"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="int" and text()="369"]'
cf6bdb
 
cf6bdb
-    assert_exists 7 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="float"]'
cf6bdb
+    assert_exists 7 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float"]'
cf6bdb
     # float: 7.4
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="float" and text()="7.400000"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float" and text()="7.400000"]'
cf6bdb
     # float_neg: -0.3
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="float" and text()="-0.300000"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float" and text()="-0.300000"]'
cf6bdb
     # float_exp: +12e03
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="float" and text()="12000.000000"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float" and text()="12000.000000"]'
cf6bdb
     # float_exp_neg: -43e-4
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="float" and text()="-0.004300"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float" and text()="-0.004300"]'
cf6bdb
     # float: .inf
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="float" and text()="inf"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float" and text()="inf"]'
cf6bdb
     # float: .NAN
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="float" and text()="nan"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float" and text()="nan"]'
cf6bdb
     # float_cast: !!float "978.65"
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype="float" and text()="978.650000"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float" and text()="978.650000"]'
cf6bdb
 
cf6bdb
     # string_true
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype!="boolean" and text()="true"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype!="boolean" and text()="true"]'
cf6bdb
     # string_number
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value_of[@datatype!="int" and text()="81"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype!="int" and text()="81"]'
cf6bdb
 
cf6bdb
     # bool_error_cast, int_error_cast, float_error_cast
cf6bdb
     co='/oval_results/results/system/oval_system_characteristics/collected_objects'
cf6bdb
     assert_exists 3 $co'/object[@flag="error"]'
cf6bdb
     assert_exists 3 $co'/object[@flag="error"]/message'
cf6bdb
 
cf6bdb
-    rm -f $result
cf6bdb
+    #rm -f $result
cf6bdb
     rm -f $YAML_FILE
cf6bdb
 
cf6bdb
 }
cf6bdb
cf6bdb
From 4f129b7142360ff4adb06aa49ee050ccf335fa8e Mon Sep 17 00:00:00 2001
cf6bdb
From: Evgeny Kolesnikov <ekolesni@redhat.com>
cf6bdb
Date: Fri, 31 Jul 2020 08:37:25 +0200
cf6bdb
Subject: [PATCH 3/8] OVAL: Fix record field evaluation
cf6bdb
cf6bdb
---
cf6bdb
 src/OVAL/oval_recordField.c        | 20 ++++++++++----------
cf6bdb
 src/OVAL/results/oval_resultTest.c |  4 ++--
cf6bdb
 2 files changed, 12 insertions(+), 12 deletions(-)
cf6bdb
cf6bdb
diff --git a/src/OVAL/oval_recordField.c b/src/OVAL/oval_recordField.c
cf6bdb
index a0c8a6a54..dd765097d 100644
cf6bdb
--- a/src/OVAL/oval_recordField.c
cf6bdb
+++ b/src/OVAL/oval_recordField.c
cf6bdb
@@ -208,7 +208,7 @@ void oval_record_field_set_mask(struct oval_record_field *rf, int mask)
cf6bdb
 void oval_record_field_set_operation(struct oval_record_field *rf, oval_operation_t operation)
cf6bdb
 {
cf6bdb
 	if (rf->record_field_type != OVAL_RECORD_FIELD_STATE) {
cf6bdb
-		dE("Wrong record field type: %d.", rf->record_field_type);
cf6bdb
+		dE("Wrong record field type (set operation): %d.", rf->record_field_type);
cf6bdb
 		return;
cf6bdb
 	}
cf6bdb
 
cf6bdb
@@ -218,7 +218,7 @@ void oval_record_field_set_operation(struct oval_record_field *rf, oval_operatio
cf6bdb
 void oval_record_field_set_variable(struct oval_record_field *rf, struct oval_variable *var)
cf6bdb
 {
cf6bdb
 	if (rf->record_field_type != OVAL_RECORD_FIELD_STATE) {
cf6bdb
-		dE("Wrong record field type: %d.", rf->record_field_type);
cf6bdb
+		dE("Wrong record field type (set variable): %d.", rf->record_field_type);
cf6bdb
 		return;
cf6bdb
 	}
cf6bdb
 
cf6bdb
@@ -228,7 +228,7 @@ void oval_record_field_set_variable(struct oval_record_field *rf, struct oval_va
cf6bdb
 void oval_record_field_set_var_check(struct oval_record_field *rf, oval_check_t var_check)
cf6bdb
 {
cf6bdb
 	if (rf->record_field_type != OVAL_RECORD_FIELD_STATE) {
cf6bdb
-		dE("Wrong record field type: %d.", rf->record_field_type);
cf6bdb
+		dE("Wrong record field type (set var_check): %d.", rf->record_field_type);
cf6bdb
 		return;
cf6bdb
 	}
cf6bdb
 
cf6bdb
@@ -238,7 +238,7 @@ void oval_record_field_set_var_check(struct oval_record_field *rf, oval_check_t
cf6bdb
 void oval_record_field_set_ent_check(struct oval_record_field *rf, oval_check_t ent_check)
cf6bdb
 {
cf6bdb
 	if (rf->record_field_type != OVAL_RECORD_FIELD_STATE) {
cf6bdb
-		dE("Wrong record field type: %d.", rf->record_field_type);
cf6bdb
+		dE("Wrong record field type (set ent_check): %d.", rf->record_field_type);
cf6bdb
 		return;
cf6bdb
 	}
cf6bdb
 
cf6bdb
@@ -248,7 +248,7 @@ void oval_record_field_set_ent_check(struct oval_record_field *rf, oval_check_t
cf6bdb
 void oval_record_field_set_status(struct oval_record_field *rf, oval_syschar_status_t status)
cf6bdb
 {
cf6bdb
 	if (rf->record_field_type != OVAL_RECORD_FIELD_ITEM) {
cf6bdb
-		dE("Wrong record field type: %d.", rf->record_field_type);
cf6bdb
+		dE("Wrong record field type (set status): %d.", rf->record_field_type);
cf6bdb
 		return;
cf6bdb
 	}
cf6bdb
 
cf6bdb
@@ -283,7 +283,7 @@ int oval_record_field_get_mask(struct oval_record_field *rf)
cf6bdb
 oval_operation_t oval_record_field_get_operation(struct oval_record_field *rf)
cf6bdb
 {
cf6bdb
 	if (rf->record_field_type != OVAL_RECORD_FIELD_STATE) {
cf6bdb
-		dE("Wrong record field type: %d.", rf->record_field_type);
cf6bdb
+		dE("Wrong record field type (get operation): %d.", rf->record_field_type);
cf6bdb
 		return OVAL_OPERATION_UNKNOWN;
cf6bdb
 	}
cf6bdb
 
cf6bdb
@@ -293,7 +293,7 @@ oval_operation_t oval_record_field_get_operation(struct oval_record_field *rf)
cf6bdb
 struct oval_variable *oval_record_field_get_variable(struct oval_record_field *rf)
cf6bdb
 {
cf6bdb
 	if (rf->record_field_type != OVAL_RECORD_FIELD_STATE) {
cf6bdb
-		dE("Wrong record field type: %d.", rf->record_field_type);
cf6bdb
+		dE("Wrong record field type (get variable): %d.", rf->record_field_type);
cf6bdb
 		return NULL;
cf6bdb
 	}
cf6bdb
 
cf6bdb
@@ -303,7 +303,7 @@ struct oval_variable *oval_record_field_get_variable(struct oval_record_field *r
cf6bdb
 oval_check_t oval_record_field_get_var_check(struct oval_record_field *rf)
cf6bdb
 {
cf6bdb
 	if (rf->record_field_type != OVAL_RECORD_FIELD_STATE) {
cf6bdb
-		dE("Wrong record field type: %d.", rf->record_field_type);
cf6bdb
+		dE("Wrong record field type (get var_check): %d.", rf->record_field_type);
cf6bdb
 		return OVAL_CHECK_UNKNOWN;
cf6bdb
 	}
cf6bdb
 
cf6bdb
@@ -313,7 +313,7 @@ oval_check_t oval_record_field_get_var_check(struct oval_record_field *rf)
cf6bdb
 oval_check_t oval_record_field_get_ent_check(struct oval_record_field *rf)
cf6bdb
 {
cf6bdb
 	if (rf->record_field_type != OVAL_RECORD_FIELD_STATE) {
cf6bdb
-		dE("Wrong record field type: %d.", rf->record_field_type);
cf6bdb
+		dE("Wrong record field type (get ent_check): %d.", rf->record_field_type);
cf6bdb
 		return OVAL_CHECK_UNKNOWN;
cf6bdb
 	}
cf6bdb
 
cf6bdb
@@ -323,7 +323,7 @@ oval_check_t oval_record_field_get_ent_check(struct oval_record_field *rf)
cf6bdb
 oval_syschar_status_t oval_record_field_get_status(struct oval_record_field *rf)
cf6bdb
 {
cf6bdb
 	if (rf->record_field_type != OVAL_RECORD_FIELD_ITEM) {
cf6bdb
-		dE("Wrong record field type: %d.", rf->record_field_type);
cf6bdb
+		dE("Wrong record field type (get status): %d.", rf->record_field_type);
cf6bdb
 		return SYSCHAR_STATUS_UNKNOWN;
cf6bdb
 	}
cf6bdb
 
cf6bdb
diff --git a/src/OVAL/results/oval_resultTest.c b/src/OVAL/results/oval_resultTest.c
cf6bdb
index 38477cb3b..00e161481 100644
cf6bdb
--- a/src/OVAL/results/oval_resultTest.c
cf6bdb
+++ b/src/OVAL/results/oval_resultTest.c
cf6bdb
@@ -458,9 +458,9 @@ static struct record_field_instance _oval_record_field_iterator_next_instance(st
cf6bdb
 	if (oval_record_field_get_type(rf) == OVAL_RECORD_FIELD_STATE) {
cf6bdb
 		instance.ent_check = oval_record_field_get_ent_check(rf);
cf6bdb
 		instance.operation = oval_record_field_get_operation(rf);
cf6bdb
+		instance.var = oval_record_field_get_variable(rf);
cf6bdb
+		instance.var_check = oval_record_field_get_var_check(rf);
cf6bdb
 	}
cf6bdb
-	instance.var = oval_record_field_get_variable(rf);
cf6bdb
-	instance.var_check = oval_record_field_get_var_check(rf);
cf6bdb
 	return instance;
cf6bdb
 }
cf6bdb
 
cf6bdb
cf6bdb
From 277548a18c4d7312df4e19da5cff38dfff56fd45 Mon Sep 17 00:00:00 2001
cf6bdb
From: Evgeny Kolesnikov <ekolesni@redhat.com>
cf6bdb
Date: Fri, 31 Jul 2020 08:38:10 +0200
cf6bdb
Subject: [PATCH 4/8] probes/yamlfilecontent: Avoid collecting empty records
cf6bdb
cf6bdb
---
cf6bdb
 .../independent/yamlfilecontent_probe.c       |  7 ++++++-
cf6bdb
 .../test_probes_yamlfilecontent_key.sh        |  2 +-
cf6bdb
 .../test_probes_yamlfilecontent_key.xml       | 20 +++++++++++++++++++
cf6bdb
 .../test_probes_yamlfilecontent_types.sh      |  2 --
cf6bdb
 4 files changed, 27 insertions(+), 4 deletions(-)
cf6bdb
cf6bdb
diff --git a/src/OVAL/probes/independent/yamlfilecontent_probe.c b/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
index f7c7d08cb..8e276dc3c 100644
cf6bdb
--- a/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
+++ b/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
@@ -206,7 +206,12 @@ static int yaml_path_query(const char *filepath, const char *yaml_path_cstr, str
cf6bdb
 		if (mapping) {
cf6bdb
 			if (event_type == YAML_MAPPING_END_EVENT) {
cf6bdb
 				mapping = false;
cf6bdb
-				oscap_list_add(values, record);
cf6bdb
+				if (record->itemcount > 0) {
cf6bdb
+					oscap_list_add(values, record);
cf6bdb
+				} else {
cf6bdb
+					// Do not collect empty records
cf6bdb
+					oscap_htable_free0(record);
cf6bdb
+				}
cf6bdb
 				record = NULL;
cf6bdb
 			} else if (event_type == YAML_MAPPING_START_EVENT) {
cf6bdb
 				result_error("YAML path '%s' points to a multi-dimensional structure", yaml_path_cstr);
cf6bdb
diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh
cf6bdb
index b25ad99f9..fc1e0ae7e 100755
cf6bdb
--- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh
cf6bdb
+++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.sh
cf6bdb
@@ -19,7 +19,7 @@ function test_probes_yamlfilecontent_key {
cf6bdb
     $OSCAP oval eval --results $RF $DF
cf6bdb
 
cf6bdb
     if [ -f $RF ]; then
cf6bdb
-        verify_results "def" $DF $RF 5 && verify_results "tst" $DF $RF 6
cf6bdb
+        verify_results "def" $DF $RF 6 && verify_results "tst" $DF $RF 7
cf6bdb
         ret_val=$?
cf6bdb
     else
cf6bdb
         ret_val=1
cf6bdb
diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml
cf6bdb
index fc3ee939e..bb40d89be 100644
cf6bdb
--- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml
cf6bdb
+++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml
cf6bdb
@@ -61,6 +61,16 @@
cf6bdb
       </criteria>
cf6bdb
     </definition>
cf6bdb
 
cf6bdb
+    <definition class="compliance" version="1" id="oval:0:def:6"> 
cf6bdb
+      <metadata>
cf6bdb
+        <title></title>
cf6bdb
+        <description></description>
cf6bdb
+      </metadata>
cf6bdb
+      <criteria operator="AND">
cf6bdb
+        <criterion comment="missing_map_keys" test_ref="oval:0:tst:7"/>
cf6bdb
+      </criteria>
cf6bdb
+    </definition>
cf6bdb
+
cf6bdb
   </definitions>
cf6bdb
 
cf6bdb
   <tests>
cf6bdb
@@ -93,6 +103,10 @@
cf6bdb
       <ind-def:state state_ref="oval:0:ste:6"/>
cf6bdb
     </ind-def:yamlfilecontent_test>
cf6bdb
 
cf6bdb
+    <ind-def:yamlfilecontent_test version="1" id="oval:0:tst:7" check="all" comment="false">
cf6bdb
+      <ind-def:object object_ref="oval:0:obj:7"/>
cf6bdb
+    </ind-def:yamlfilecontent_test>
cf6bdb
+
cf6bdb
   </tests>
cf6bdb
 
cf6bdb
   <objects>
cf6bdb
@@ -133,6 +147,12 @@
cf6bdb
       <ind-def:yamlpath>.status.conditions[:]</ind-def:yamlpath>
cf6bdb
     </ind-def:yamlfilecontent_object>
cf6bdb
 
cf6bdb
+    <ind-def:yamlfilecontent_object version="1" id="oval:0:obj:7">
cf6bdb
+      <ind-def:path>/tmp</ind-def:path>
cf6bdb
+      <ind-def:filename>openshift-logging.yaml</ind-def:filename>
cf6bdb
+      <ind-def:yamlpath>.status.conditions[:]['nonexistent','dummy']</ind-def:yamlpath>
cf6bdb
+    </ind-def:yamlfilecontent_object>
cf6bdb
+
cf6bdb
   </objects>
cf6bdb
 
cf6bdb
   <states>
cf6bdb
diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh
cf6bdb
index 8b0614fc6..83910ed38 100755
cf6bdb
--- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh
cf6bdb
+++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh
cf6bdb
@@ -66,9 +66,7 @@ function test_probes_yamlfilecontent_types {
cf6bdb
     assert_exists 3 $co'/object[@flag="error"]'
cf6bdb
     assert_exists 3 $co'/object[@flag="error"]/message'
cf6bdb
 
cf6bdb
-    #rm -f $result
cf6bdb
     rm -f $YAML_FILE
cf6bdb
-
cf6bdb
 }
cf6bdb
 
cf6bdb
 test_probes_yamlfilecontent_types
cf6bdb
cf6bdb
From 8d64db6203c02d3326c9e3336464bb2333d8f9f4 Mon Sep 17 00:00:00 2001
cf6bdb
From: Evgeny Kolesnikov <ekolesni@redhat.com>
cf6bdb
Date: Wed, 23 Sep 2020 13:34:59 +0200
cf6bdb
Subject: [PATCH 5/8] Revert changes in base OVAL schema
cf6bdb
cf6bdb
And adjust probe implementation and tests for the workaround (lowercase
cf6bdb
and escape capital letters in field names with ^, use # instead
cf6bdb
of empty field names for scalars).
cf6bdb
---
cf6bdb
 .../5.11.3/independent-definitions-schema.xsd |  8 ++--
cf6bdb
 ...ependent-system-characteristics-schema.xsd |  4 +-
cf6bdb
 .../oval/5.11.3/oval-definitions-schema.xsd   | 14 +++++-
cf6bdb
 .../oval-system-characteristics-schema.xsd    |  7 ++-
cf6bdb
 .../independent/yamlfilecontent_probe.c       | 43 ++++++++++++++++---
cf6bdb
 .../test_probes_yamlfilecontent_array.xml     |  4 +-
cf6bdb
 .../test_probes_yamlfilecontent_key.xml       | 23 ++++++++--
cf6bdb
 ...st_probes_yamlfilecontent_offline_mode.xml |  6 +--
cf6bdb
 .../test_probes_yamlfilecontent_types.sh      | 38 ++++++++--------
cf6bdb
 9 files changed, 106 insertions(+), 41 deletions(-)
cf6bdb
cf6bdb
diff --git a/schemas/oval/5.11.3/independent-definitions-schema.xsd b/schemas/oval/5.11.3/independent-definitions-schema.xsd
cf6bdb
index 0f202abf6..4168b45bf 100644
cf6bdb
--- a/schemas/oval/5.11.3/independent-definitions-schema.xsd
cf6bdb
+++ b/schemas/oval/5.11.3/independent-definitions-schema.xsd
cf6bdb
@@ -2115,7 +2115,7 @@
cf6bdb
                                                 </xsd:choice>
cf6bdb
                                                 <xsd:element name="yamlpath" type="oval-def:EntityObjectStringType">
cf6bdb
                                                       <xsd:annotation>
cf6bdb
-                                                            <xsd:documentation>Specifies an YAML Path expression to evaluate against the YAML file specified by the filename entity. This YAML Path expression must evaluate to a list or a map (part of a map) of zero or more scalar values which will be accessible in OVAL via instances of the result entity. Any results from evaluating the YAML Path expression other than a list of scalar values (or a map with scalar values) at the bottom level (e.g. list of lists, list of maps, map with maps or lists) is considered an error, so the author should define the YAML Path expression carefully. Note that "equals" is the only valid operator for the yamlpath entity.</xsd:documentation>
cf6bdb
+                                                            <xsd:documentation>Specifies an YAML Path expression to evaluate against the YAML file specified by the filename entity. This YAML Path expression must evaluate to a sequence or a map (part of a map) of scalar values which will be accessible in OVAL via instances of the value entity. Any results from evaluating the YAML Path expression other than a sequence (or a map) of scalar values (e.g. sequence of sequences, sequence of maps, map of maps etc.) are considered as incorrect, so the author should define the YAML Path expression carefully. Note that "equals" is the only valid operator for the yamlpath entity.</xsd:documentation>
cf6bdb
                                                             <xsd:appinfo>
cf6bdb
                                                                   <sch:pattern id="ind-def_yamlobjyamlpath">
cf6bdb
                                                                         <sch:rule context="ind-def:yamlfilecontent_object/ind-def:yamlpath">
cf6bdb
@@ -2158,12 +2158,12 @@
cf6bdb
                                     </xsd:element>
cf6bdb
                                     <xsd:element name="yamlpath" type="oval-def:EntityStateStringType" minOccurs="0" maxOccurs="1">
cf6bdb
                                           <xsd:annotation>
cf6bdb
-                                                <xsd:documentation>Specifies an YAML Path expression to evaluate against the YAML file specified by the filename entity. This YAML Path expression must evaluate to a list or a map (part of a map) of zero or more scalar values which will be accessible in OVAL via instances of the result entity. Any results from evaluating the YAML Path expression other than a list of scalar values (or a map with scalar values) at the bottom level (e.g. list of lists, list of maps, map with maps or lists) is considered an error, so the author should define the YAML Path expression carefully. Note that "equals" is the only valid operator for the yamlpath entity.</xsd:documentation>
cf6bdb
+                                                <xsd:documentation>Specifies an YAML Path expression to evaluate against the YAML file specified by the filename entity. Note that "equals" is the only valid operator for the yamlpath entity.</xsd:documentation>
cf6bdb
                                           </xsd:annotation>
cf6bdb
                                     </xsd:element>
cf6bdb
                                     <xsd:element name="value" type="oval-def:EntityStateRecordType" minOccurs="0">
cf6bdb
                                           <xsd:annotation>
cf6bdb
-                                                <xsd:documentation>The value entity specifies how to test objects in the value set of the specified YAML Path. To define tests for a signle scalar value or a list of scalar values, set name attribute of the field child element to an empty string (''). The check is entirely controlled by operator attributes of the field element.</xsd:documentation>
cf6bdb
+                                                <xsd:documentation>The value entity specifies how to test objects in the value set of the specified YAML Path. To define tests for a signle scalar value or a list of scalar values (where there is no key to associate), set the name attribute of the field element to '#'. Due to the limitation of the record type field names could not contain uppercase letters, they will be converted to the lowercase and escaped using the '^' symbol (the '^' symbol would be escaped as well). For example 'myCamelCase^Key' would be collected as 'my^camel^case^^^key'. The check is entirely controlled by operator attributes of the field element.</xsd:documentation>
cf6bdb
                                                 <xsd:appinfo>
cf6bdb
                                                       <sch:pattern id="ind-def_yamlfilestevalue">
cf6bdb
                                                             <sch:rule context="ind-def:yamlfile_state/ind-def:value">
cf6bdb
@@ -2172,7 +2172,7 @@
cf6bdb
                                                       </sch:pattern>
cf6bdb
                                                 </xsd:appinfo>
cf6bdb
                                           </xsd:annotation>
cf6bdb
-                                          <xsd:unique name="UniqueYamlFileResultFieldName">
cf6bdb
+                                          <xsd:unique name="UniqueYamlFileValueFieldName">
cf6bdb
                                                 <xsd:selector xpath="./oval-def:field"/>
cf6bdb
                                                 <xsd:field xpath="@name"/>
cf6bdb
                                           </xsd:unique>
cf6bdb
diff --git a/schemas/oval/5.11.3/independent-system-characteristics-schema.xsd b/schemas/oval/5.11.3/independent-system-characteristics-schema.xsd
cf6bdb
index b2934d4c6..9c108297b 100644
cf6bdb
--- a/schemas/oval/5.11.3/independent-system-characteristics-schema.xsd
cf6bdb
+++ b/schemas/oval/5.11.3/independent-system-characteristics-schema.xsd
cf6bdb
@@ -606,12 +606,12 @@
cf6bdb
                               </xsd:element>
cf6bdb
                               <xsd:element name="yamlpath" type="oval-sc:EntityItemStringType" minOccurs="0" maxOccurs="1">
cf6bdb
                                    <xsd:annotation>
cf6bdb
-                                        <xsd:documentation>Specifies an YAML Path expression to evaluate against the YAML file specified by the filename entity. This YAML Path expression must evaluate to a list or a map (part of a map) of zero or more scalar values which will be accessible in OVAL via instances of the result entity. Any results from evaluating the YAML Path expression other than a list of scalar values (or a map with scalar values) at the bottom level (e.g. list of lists, list of maps, map with maps or lists) is considered an error, so the author should define the YAML Path expression carefully. Note that "equals" is the only valid operator for the yamlpath entity.</xsd:documentation>
cf6bdb
+                                        <xsd:documentation>Specifies an YAML Path expression to evaluate against the YAML file specified by the filename entity. Note that "equals" is the only valid operator for the yamlpath entity.</xsd:documentation>
cf6bdb
                                    </xsd:annotation>
cf6bdb
                               </xsd:element>
cf6bdb
                               <xsd:element name="value" type="oval-sc:EntityItemRecordType" minOccurs="0" maxOccurs="unbounded">
cf6bdb
                                    <xsd:annotation>
cf6bdb
-                                        <xsd:documentation>The value entity holds the target(s) of the specified YAML Path. If YAML Path target is a signle scalar value or a list of scalar values, the field child element's name would be empty (''). The check is entirely controlled by operator attributes of the field element.</xsd:documentation>
cf6bdb
+                                        <xsd:documentation>The value entity holds the target(s) of the specified YAML Path. To define tests for a signle scalar value or a list of scalar values (where there is no key to associate), set the name attribute of the field element to '#'. Due to the limitation of the record type field names could not contain uppercase letters, they will be converted to the lowercase and escaped using the '^' symbol (the '^' symbol would be escaped as well). For example 'myCamelCase^Key' would be collected as 'my^camel^case^^^key'. The check is entirely controlled by operator attributes of the field element.</xsd:documentation>
cf6bdb
                                         <xsd:appinfo>
cf6bdb
                                              <sch:pattern id="ind-sc_yamlfile_itemvalue">
cf6bdb
                                                   <sch:rule context="ind-sc:yamlfile_item/ind-sc:value">
cf6bdb
diff --git a/schemas/oval/5.11.3/oval-definitions-schema.xsd b/schemas/oval/5.11.3/oval-definitions-schema.xsd
cf6bdb
index a57b889cf..f43abd318 100644
cf6bdb
--- a/schemas/oval/5.11.3/oval-definitions-schema.xsd
cf6bdb
+++ b/schemas/oval/5.11.3/oval-definitions-schema.xsd
cf6bdb
@@ -1553,8 +1553,13 @@
cf6bdb
             <xsd:extension base="xsd:anySimpleType">
cf6bdb
                 <xsd:attribute name="name" use="required">
cf6bdb
                     <xsd:annotation>
cf6bdb
-                        <xsd:documentation>A string.</xsd:documentation>
cf6bdb
+                        <xsd:documentation>A string restricted to disallow upper case characters.</xsd:documentation>
cf6bdb
                     </xsd:annotation>
cf6bdb
+                    <xsd:simpleType>
cf6bdb
+                        <xsd:restriction base="xsd:string">
cf6bdb
+                            <xsd:pattern value="[^A-Z]+"/>
cf6bdb
+                        </xsd:restriction>
cf6bdb
+                    </xsd:simpleType>
cf6bdb
                 </xsd:attribute>
cf6bdb
                 <xsd:attributeGroup ref="oval-def:EntityAttributeGroup"/>
cf6bdb
                 <xsd:attribute name="entity_check" type="oval:CheckEnumeration" use="optional" default="all"/>
cf6bdb
@@ -1819,8 +1824,13 @@
cf6bdb
             <xsd:extension base="xsd:anySimpleType">
cf6bdb
                 <xsd:attribute name="name" use="required">
cf6bdb
                     <xsd:annotation>
cf6bdb
-                        <xsd:documentation>A string.</xsd:documentation>
cf6bdb
+                        <xsd:documentation>A string restricted to disallow upper case characters.</xsd:documentation>
cf6bdb
                     </xsd:annotation>
cf6bdb
+                    <xsd:simpleType>
cf6bdb
+                        <xsd:restriction base="xsd:string">
cf6bdb
+                            <xsd:pattern value="[^A-Z]+"/>
cf6bdb
+                        </xsd:restriction>
cf6bdb
+                    </xsd:simpleType>
cf6bdb
                 </xsd:attribute>
cf6bdb
                 <xsd:attributeGroup ref="oval-def:EntityAttributeGroup"/>
cf6bdb
                 <xsd:attribute name="entity_check" type="oval:CheckEnumeration" use="optional" default="all"/>
cf6bdb
diff --git a/schemas/oval/5.11.3/oval-system-characteristics-schema.xsd b/schemas/oval/5.11.3/oval-system-characteristics-schema.xsd
cf6bdb
index 543b2db71..30962f330 100644
cf6bdb
--- a/schemas/oval/5.11.3/oval-system-characteristics-schema.xsd
cf6bdb
+++ b/schemas/oval/5.11.3/oval-system-characteristics-schema.xsd
cf6bdb
@@ -574,8 +574,13 @@
cf6bdb
             <xsd:extension base="xsd:anySimpleType">
cf6bdb
                 <xsd:attribute name="name" use="required">
cf6bdb
                     <xsd:annotation>
cf6bdb
-                        <xsd:documentation>A string.</xsd:documentation>
cf6bdb
+                        <xsd:documentation>A string restricted to disallow upper case characters.</xsd:documentation>
cf6bdb
                     </xsd:annotation>
cf6bdb
+                    <xsd:simpleType>
cf6bdb
+                        <xsd:restriction base="xsd:string">
cf6bdb
+                            <xsd:pattern value="[^A-Z]+"/>
cf6bdb
+                        </xsd:restriction>
cf6bdb
+                    </xsd:simpleType>
cf6bdb
                 </xsd:attribute>
cf6bdb
                 <xsd:attributeGroup ref="oval-sc:EntityAttributeGroup"/>
cf6bdb
             </xsd:extension>
cf6bdb
diff --git a/src/OVAL/probes/independent/yamlfilecontent_probe.c b/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
index 8e276dc3c..641709bb9 100644
cf6bdb
--- a/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
+++ b/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
@@ -148,6 +148,39 @@ do {                                                                     \
cf6bdb
 	ret = -1;                                                            \
cf6bdb
 } while (0)
cf6bdb
 
cf6bdb
+static char *escape_key(char *key)
cf6bdb
+{
cf6bdb
+	if (key == NULL)
cf6bdb
+		return NULL;
cf6bdb
+
cf6bdb
+	size_t cap_letters = 0;
cf6bdb
+	size_t key_len = strlen(key);
cf6bdb
+	for (size_t i = 0; i < key_len; i++)
cf6bdb
+		if ((key[i] >= 'A' && key[i] <= 'Z') || key[i] == '^')
cf6bdb
+			cap_letters++;
cf6bdb
+
cf6bdb
+	if (cap_letters == 0)
cf6bdb
+		return key;
cf6bdb
+
cf6bdb
+	char *new_key = realloc(key, key_len + 1 + cap_letters);
cf6bdb
+	if (new_key == NULL)
cf6bdb
+		return key;
cf6bdb
+	new_key[key_len + cap_letters] = '\0';
cf6bdb
+
cf6bdb
+	for (ssize_t i = key_len; i >= 0; i--) {
cf6bdb
+		if ((new_key[i] >= 'A' && new_key[i] <= 'Z') || new_key[i] == '^') {
cf6bdb
+			if (new_key[i] != '^')
cf6bdb
+				new_key[i] += 32;
cf6bdb
+			memmove(new_key + i + cap_letters, new_key + i, key_len - i);
cf6bdb
+			new_key[i + cap_letters - 1] = '^';
cf6bdb
+			cap_letters--;
cf6bdb
+			key_len = i;
cf6bdb
+		}
cf6bdb
+	}
cf6bdb
+
cf6bdb
+	return new_key;
cf6bdb
+}
cf6bdb
+
cf6bdb
 static int yaml_path_query(const char *filepath, const char *yaml_path_cstr, struct oscap_list *values, probe_ctx *ctx)
cf6bdb
 {
cf6bdb
 	int ret = 0;
cf6bdb
@@ -174,7 +207,7 @@ static int yaml_path_query(const char *filepath, const char *yaml_path_cstr, str
cf6bdb
 	bool sequence = false;
cf6bdb
 	bool mapping = false;
cf6bdb
 	int index = 0;
cf6bdb
-	char *key = strdup("");
cf6bdb
+	char *key = strdup("#");
cf6bdb
 
cf6bdb
 	struct oscap_htable *record = NULL;
cf6bdb
 
cf6bdb
@@ -194,7 +227,7 @@ static int yaml_path_query(const char *filepath, const char *yaml_path_cstr, str
cf6bdb
 			if (event_type == YAML_SEQUENCE_END_EVENT) {
cf6bdb
 				sequence = false;
cf6bdb
 			} else if (event_type == YAML_SEQUENCE_START_EVENT) {
cf6bdb
-				result_error("YAML path '%s' points to a multi-dimensional structure", yaml_path_cstr);
cf6bdb
+				result_error("YAML path '%s' points to a multi-dimensional structure (sequence containing another sequence)", yaml_path_cstr);
cf6bdb
 				goto cleanup;
cf6bdb
 			}
cf6bdb
 		} else {
cf6bdb
@@ -214,13 +247,13 @@ static int yaml_path_query(const char *filepath, const char *yaml_path_cstr, str
cf6bdb
 				}
cf6bdb
 				record = NULL;
cf6bdb
 			} else if (event_type == YAML_MAPPING_START_EVENT) {
cf6bdb
-				result_error("YAML path '%s' points to a multi-dimensional structure", yaml_path_cstr);
cf6bdb
+				result_error("YAML path '%s' points to a multi-dimensional structure (map containing another map)", yaml_path_cstr);
cf6bdb
 				goto cleanup;
cf6bdb
 			}
cf6bdb
 		} else {
cf6bdb
 			if (event_type == YAML_MAPPING_START_EVENT) {
cf6bdb
 				if (record) {
cf6bdb
-					result_error("YAML path '%s' points to a multi-dimensional structure", yaml_path_cstr);
cf6bdb
+					result_error("YAML path '%s' points to an invalid structure (map containing another map)", yaml_path_cstr);
cf6bdb
 					goto cleanup;
cf6bdb
 				}
cf6bdb
 				mapping = true;
cf6bdb
@@ -235,7 +268,7 @@ static int yaml_path_query(const char *filepath, const char *yaml_path_cstr, str
cf6bdb
 				if (!sequence) {
cf6bdb
 					if (index++ % 2 == 0) {
cf6bdb
 						free(key);
cf6bdb
-						key = strdup((const char *) event.data.scalar.value);
cf6bdb
+						key = escape_key(strdup((const char *) event.data.scalar.value));
cf6bdb
 						goto next;
cf6bdb
 					}
cf6bdb
 				}
cf6bdb
diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.xml b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.xml
cf6bdb
index 9a4227fb8..9fd92492e 100644
cf6bdb
--- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.xml
cf6bdb
+++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.xml
cf6bdb
@@ -77,13 +77,13 @@
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:1">
cf6bdb
       <ind-def:value datatype="record">
cf6bdb
-        <field name="" datatype="string">secureforward-offcluster</field>
cf6bdb
+        <field name="#" datatype="string">secureforward-offcluster</field>
cf6bdb
       </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:2">
cf6bdb
       <ind-def:value datatype="record">
cf6bdb
-        <field name="" datatype="string" var_ref="oval:0:var:2" var_check="at least one" entity_check="at least one"/>
cf6bdb
+        <field name="#" datatype="string" var_ref="oval:0:var:2" var_check="at least one" entity_check="at least one"/>
cf6bdb
       </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml
cf6bdb
index bb40d89be..05757d0c8 100644
cf6bdb
--- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml
cf6bdb
+++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_key.xml
cf6bdb
@@ -71,6 +71,15 @@
cf6bdb
       </criteria>
cf6bdb
     </definition>
cf6bdb
 
cf6bdb
+    <definition class="compliance" version="1" id="oval:0:def:7"> 
cf6bdb
+      <metadata>
cf6bdb
+        <title></title>
cf6bdb
+        <description></description>
cf6bdb
+      </metadata>
cf6bdb
+      <criteria operator="AND">
cf6bdb
+        <criterion comment="array_of_maps" test_ref="oval:0:tst:8"/>
cf6bdb
+      </criteria>
cf6bdb
+    </definition>
cf6bdb
   </definitions>
cf6bdb
 
cf6bdb
   <tests>
cf6bdb
@@ -107,6 +116,9 @@
cf6bdb
       <ind-def:object object_ref="oval:0:obj:7"/>
cf6bdb
     </ind-def:yamlfilecontent_test>
cf6bdb
 
cf6bdb
+    <ind-def:yamlfilecontent_test version="1" id="oval:0:tst:8" check="all" comment="true">
cf6bdb
+      <ind-def:object object_ref="oval:0:obj:8"/>
cf6bdb
+    </ind-def:yamlfilecontent_test>
cf6bdb
   </tests>
cf6bdb
 
cf6bdb
   <objects>
cf6bdb
@@ -153,19 +165,24 @@
cf6bdb
       <ind-def:yamlpath>.status.conditions[:]['nonexistent','dummy']</ind-def:yamlpath>
cf6bdb
     </ind-def:yamlfilecontent_object>
cf6bdb
 
cf6bdb
+    <ind-def:yamlfilecontent_object version="1" id="oval:0:obj:8">
cf6bdb
+      <ind-def:path>/tmp</ind-def:path>
cf6bdb
+      <ind-def:filename>openshift-logging.yaml</ind-def:filename>
cf6bdb
+      <ind-def:yamlpath>.spec.outputs</ind-def:yamlpath>
cf6bdb
+    </ind-def:yamlfilecontent_object>
cf6bdb
   </objects>
cf6bdb
 
cf6bdb
   <states>
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:1">
cf6bdb
       <ind-def:value datatype="record">
cf6bdb
-        <field name="" datatype="string">LogForwarding</field>
cf6bdb
+        <field name="#" datatype="string">LogForwarding</field>
cf6bdb
       </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:2">
cf6bdb
       <ind-def:value datatype="record">
cf6bdb
-        <field name="" datatype="string">openshift-logging</field>
cf6bdb
+        <field name="#" datatype="string">openshift-logging</field>
cf6bdb
       </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
@@ -181,7 +198,7 @@
cf6bdb
         <field name="status" datatype="string">True</field>
cf6bdb
         <field name="reason" datatype="string">AsExpected</field>
cf6bdb
         <field name="type" datatype="string">Upgradeable</field>
cf6bdb
-        <field name="lastTransitionTime" datatype="string" operation="pattern match">^\d+-\d+-.*Z$</field>
cf6bdb
+        <field name="last^transition^time" datatype="string" operation="pattern match">^\d+-\d+-.*Z$</field>
cf6bdb
       </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.xml b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.xml
cf6bdb
index 5c7cf5b28..35a646688 100644
cf6bdb
--- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.xml
cf6bdb
+++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_offline_mode.xml
cf6bdb
@@ -86,19 +86,19 @@
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:1">
cf6bdb
       <ind-def:value datatype="record">
cf6bdb
-        <field name="" datatype="string">instance</field>
cf6bdb
+        <field name="#" datatype="string">instance</field>
cf6bdb
       </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:2">
cf6bdb
       <ind-def:value datatype="record">
cf6bdb
-        <field name="" datatype="string">outstance</field>
cf6bdb
+        <field name="#" datatype="string">outstance</field>
cf6bdb
       </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_state version="1" id="oval:0:ste:3">
cf6bdb
       <ind-def:value datatype="record">
cf6bdb
-        <field name="" datatype="string">instance</field>
cf6bdb
+        <field name="#" datatype="string">instance</field>
cf6bdb
       </ind-def:value>
cf6bdb
     </ind-def:yamlfilecontent_state>
cf6bdb
 
cf6bdb
diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh
cf6bdb
index 83910ed38..4f110f6eb 100755
cf6bdb
--- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh
cf6bdb
+++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_types.sh
cf6bdb
@@ -24,42 +24,42 @@ function test_probes_yamlfilecontent_types {
cf6bdb
 
cf6bdb
     sd='/oval_results/results/system/oval_system_characteristics/system_data'
cf6bdb
 
cf6bdb
-    assert_exists 8 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="boolean"]'
cf6bdb
-    assert_exists 4 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="boolean" and text()="true"]'
cf6bdb
-    assert_exists 4 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="boolean" and text()="false"]'
cf6bdb
+    assert_exists 8 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="boolean"]'
cf6bdb
+    assert_exists 4 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="boolean" and text()="true"]'
cf6bdb
+    assert_exists 4 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="boolean" and text()="false"]'
cf6bdb
 
cf6bdb
-    assert_exists 5 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="int"]'
cf6bdb
+    assert_exists 5 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="int"]'
cf6bdb
     # int_10: 42
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="int" and text()="42"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="int" and text()="42"]'
cf6bdb
     # int_10_neg: -17
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="int" and text()="-17"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="int" and text()="-17"]'
cf6bdb
     # int_8: 0o33
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="int" and text()="27"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="int" and text()="27"]'
cf6bdb
     # int_16: 0xFF
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="int" and text()="255"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="int" and text()="255"]'
cf6bdb
     # int_cast: !!int "369"
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="int" and text()="369"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="int" and text()="369"]'
cf6bdb
 
cf6bdb
-    assert_exists 7 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float"]'
cf6bdb
+    assert_exists 7 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="float"]'
cf6bdb
     # float: 7.4
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float" and text()="7.400000"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="float" and text()="7.400000"]'
cf6bdb
     # float_neg: -0.3
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float" and text()="-0.300000"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="float" and text()="-0.300000"]'
cf6bdb
     # float_exp: +12e03
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float" and text()="12000.000000"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="float" and text()="12000.000000"]'
cf6bdb
     # float_exp_neg: -43e-4
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float" and text()="-0.004300"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="float" and text()="-0.004300"]'
cf6bdb
     # float: .inf
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float" and text()="inf"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="float" and text()="inf"]'
cf6bdb
     # float: .NAN
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float" and text()="nan"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="float" and text()="nan"]'
cf6bdb
     # float_cast: !!float "978.65"
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype="float" and text()="978.650000"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype="float" and text()="978.650000"]'
cf6bdb
 
cf6bdb
     # string_true
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype!="boolean" and text()="true"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype!="boolean" and text()="true"]'
cf6bdb
     # string_number
cf6bdb
-    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="" and @datatype!="int" and text()="81"]'
cf6bdb
+    assert_exists 1 $sd'/ind-sys:yamlfilecontent_item/ind-sys:value/field[@name="#" and @datatype!="int" and text()="81"]'
cf6bdb
 
cf6bdb
     # bool_error_cast, int_error_cast, float_error_cast
cf6bdb
     co='/oval_results/results/system/oval_system_characteristics/collected_objects'
cf6bdb
cf6bdb
From 5f9b9b6686e9d1b05094cdda8d5d1339ed4e8547 Mon Sep 17 00:00:00 2001
cf6bdb
From: Evgeny Kolesnikov <ekolesni@redhat.com>
cf6bdb
Date: Thu, 24 Sep 2020 11:21:02 +0200
cf6bdb
Subject: [PATCH 6/8] Bump yaml-filter
cf6bdb
cf6bdb
---
cf6bdb
 src/OVAL/probes/independent/yamlfilecontent_probe.c            | 3 +--
cf6bdb
 .../yamlfilecontent/test_probes_yamlfilecontent_array.xml      | 2 +-
cf6bdb
 yaml-filter                                                    | 2 +-
cf6bdb
 3 files changed, 3 insertions(+), 4 deletions(-)
cf6bdb
cf6bdb
diff --git a/src/OVAL/probes/independent/yamlfilecontent_probe.c b/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
index 641709bb9..b57956765 100644
cf6bdb
--- a/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
+++ b/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
@@ -216,8 +216,7 @@ static int yaml_path_query(const char *filepath, const char *yaml_path_cstr, str
cf6bdb
 			result_error("YAML parser error: %s", parser.problem);
cf6bdb
 			goto cleanup;
cf6bdb
 		}
cf6bdb
-		if (!yaml_path_filter_event(yaml_path, &parser, &event,
cf6bdb
-				YAML_PATH_FILTER_RETURN_ALL)) {
cf6bdb
+		if (yaml_path_filter_event(yaml_path, &parser, &event) == YAML_PATH_FILTER_RESULT_OUT) {
cf6bdb
 			goto next;
cf6bdb
 		}
cf6bdb
 
cf6bdb
diff --git a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.xml b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.xml
cf6bdb
index 9fd92492e..c05c5fbb9 100644
cf6bdb
--- a/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.xml
cf6bdb
+++ b/tests/probes/yamlfilecontent/test_probes_yamlfilecontent_array.xml
cf6bdb
@@ -62,7 +62,7 @@
cf6bdb
     <ind-def:yamlfilecontent_object version="1" id="oval:0:obj:2">
cf6bdb
       <ind-def:path>/tmp</ind-def:path>
cf6bdb
       <ind-def:filename>openshift-logging.yaml</ind-def:filename>
cf6bdb
-      <ind-def:yamlpath>.spec.outputs[0:2].name</ind-def:yamlpath>
cf6bdb
+      <ind-def:yamlpath>.spec.outputs[:].name</ind-def:yamlpath>
cf6bdb
     </ind-def:yamlfilecontent_object>
cf6bdb
 
cf6bdb
     <ind-def:yamlfilecontent_object version="1" id="oval:0:obj:3">
cf6bdb
cf6bdb
From 183e3517365890d0e704460fdb6e99672c469d22 Mon Sep 17 00:00:00 2001
cf6bdb
From: Evgeny Kolesnikov <ekolesni@redhat.com>
cf6bdb
Date: Tue, 29 Sep 2020 10:42:22 +0200
cf6bdb
Subject: [PATCH 7/8] Update schemas
cf6bdb
cf6bdb
---
cf6bdb
 .../5.11.3/independent-definitions-schema.xsd  |  2 +-
cf6bdb
 ...dependent-system-characteristics-schema.xsd |  2 +-
cf6bdb
 .../probes/independent/yamlfilecontent_probe.c | 18 +++++++++---------
cf6bdb
 3 files changed, 11 insertions(+), 11 deletions(-)
cf6bdb
cf6bdb
diff --git a/schemas/oval/5.11.3/independent-definitions-schema.xsd b/schemas/oval/5.11.3/independent-definitions-schema.xsd
cf6bdb
index 4168b45bf..d9a891d23 100644
cf6bdb
--- a/schemas/oval/5.11.3/independent-definitions-schema.xsd
cf6bdb
+++ b/schemas/oval/5.11.3/independent-definitions-schema.xsd
cf6bdb
@@ -2163,7 +2163,7 @@
cf6bdb
                                     </xsd:element>
cf6bdb
                                     <xsd:element name="value" type="oval-def:EntityStateRecordType" minOccurs="0">
cf6bdb
                                           <xsd:annotation>
cf6bdb
-                                                <xsd:documentation>The value entity specifies how to test objects in the value set of the specified YAML Path. To define tests for a signle scalar value or a list of scalar values (where there is no key to associate), set the name attribute of the field element to '#'. Due to the limitation of the record type field names could not contain uppercase letters, they will be converted to the lowercase and escaped using the '^' symbol (the '^' symbol would be escaped as well). For example 'myCamelCase^Key' would be collected as 'my^camel^case^^^key'. The check is entirely controlled by operator attributes of the field element.</xsd:documentation>
cf6bdb
+                                                <xsd:documentation>The value entity specifies how to test objects in the value set of the specified YAML Path. To define tests for a single scalar value or a list of scalar values (where there is no key to associate), set the name attribute of the field element to '#'. Due to the limitation of the record type field names could not contain uppercase letters, they should be converted to the lowercase and escaped using the '^' symbol (the '^' symbol should be escaped as well). For example, to check a value associated with 'myCamelCase^Key' set the name attribute of the field to 'my^camel^case^^^key'. The check is entirely controlled by operator attributes of the field element.</xsd:documentation>
cf6bdb
                                                 <xsd:appinfo>
cf6bdb
                                                       <sch:pattern id="ind-def_yamlfilestevalue">
cf6bdb
                                                             <sch:rule context="ind-def:yamlfile_state/ind-def:value">
cf6bdb
diff --git a/schemas/oval/5.11.3/independent-system-characteristics-schema.xsd b/schemas/oval/5.11.3/independent-system-characteristics-schema.xsd
cf6bdb
index 9c108297b..c2a2aab50 100644
cf6bdb
--- a/schemas/oval/5.11.3/independent-system-characteristics-schema.xsd
cf6bdb
+++ b/schemas/oval/5.11.3/independent-system-characteristics-schema.xsd
cf6bdb
@@ -611,7 +611,7 @@
cf6bdb
                               </xsd:element>
cf6bdb
                               <xsd:element name="value" type="oval-sc:EntityItemRecordType" minOccurs="0" maxOccurs="unbounded">
cf6bdb
                                    <xsd:annotation>
cf6bdb
-                                        <xsd:documentation>The value entity holds the target(s) of the specified YAML Path. To define tests for a signle scalar value or a list of scalar values (where there is no key to associate), set the name attribute of the field element to '#'. Due to the limitation of the record type field names could not contain uppercase letters, they will be converted to the lowercase and escaped using the '^' symbol (the '^' symbol would be escaped as well). For example 'myCamelCase^Key' would be collected as 'my^camel^case^^^key'. The check is entirely controlled by operator attributes of the field element.</xsd:documentation>
cf6bdb
+                                        <xsd:documentation>The value entity holds the target(s) of the specified YAML Path. A single scalar value or a list of scalar values (where there is no key to associate) would have the name attribute of the field element set to '#'. Due to the limitation of the record type field names could not contain uppercase letters, they will be converted to the lowercase and escaped using the '^' symbol (the '^' symbol would be escaped as well). For example 'myCamelCase^Key' would be collected as 'my^camel^case^^^key'.</xsd:documentation>
cf6bdb
                                         <xsd:appinfo>
cf6bdb
                                              <sch:pattern id="ind-sc_yamlfile_itemvalue">
cf6bdb
                                                   <sch:rule context="ind-sc:yamlfile_item/ind-sc:value">
cf6bdb
diff --git a/src/OVAL/probes/independent/yamlfilecontent_probe.c b/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
index b57956765..72e5638ae 100644
cf6bdb
--- a/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
+++ b/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
@@ -139,15 +139,6 @@ static SEXP_t *yaml_scalar_event_to_sexp(yaml_event_t *event)
cf6bdb
 	return SEXP_string_new(value, strlen(value));
cf6bdb
 }
cf6bdb
 
cf6bdb
-#define result_error(fmt, args...)                                       \
cf6bdb
-do {                                                                     \
cf6bdb
-	SEXP_t *msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR, fmt, args); \
cf6bdb
-	probe_cobj_add_msg(probe_ctx_getresult(ctx), msg);                   \
cf6bdb
-	SEXP_free(msg);                                                      \
cf6bdb
-	probe_cobj_set_flag(probe_ctx_getresult(ctx), SYSCHAR_FLAG_ERROR);   \
cf6bdb
-	ret = -1;                                                            \
cf6bdb
-} while (0)
cf6bdb
-
cf6bdb
 static char *escape_key(char *key)
cf6bdb
 {
cf6bdb
 	if (key == NULL)
cf6bdb
@@ -181,6 +172,15 @@ static char *escape_key(char *key)
cf6bdb
 	return new_key;
cf6bdb
 }
cf6bdb
 
cf6bdb
+#define result_error(fmt, args...)                                       \
cf6bdb
+do {                                                                     \
cf6bdb
+	SEXP_t *msg = probe_msg_creatf(OVAL_MESSAGE_LEVEL_ERROR, fmt, args); \
cf6bdb
+	probe_cobj_add_msg(probe_ctx_getresult(ctx), msg);                   \
cf6bdb
+	SEXP_free(msg);                                                      \
cf6bdb
+	probe_cobj_set_flag(probe_ctx_getresult(ctx), SYSCHAR_FLAG_ERROR);   \
cf6bdb
+	ret = -1;                                                            \
cf6bdb
+} while (0)
cf6bdb
+
cf6bdb
 static int yaml_path_query(const char *filepath, const char *yaml_path_cstr, struct oscap_list *values, probe_ctx *ctx)
cf6bdb
 {
cf6bdb
 	int ret = 0;
cf6bdb
cf6bdb
From 227cce0560574d3f2efd75e884152f1fb1a7c619 Mon Sep 17 00:00:00 2001
cf6bdb
From: Evgeny Kolesnikov <ekolesni@redhat.com>
cf6bdb
Date: Tue, 29 Sep 2020 15:31:41 +0200
cf6bdb
Subject: [PATCH 8/8] probes/yamlfilecontent: Add missed SEXP_free
cf6bdb
cf6bdb
---
cf6bdb
 src/OVAL/probes/independent/yamlfilecontent_probe.c | 1 +
cf6bdb
 1 file changed, 1 insertion(+)
cf6bdb
cf6bdb
diff --git a/src/OVAL/probes/independent/yamlfilecontent_probe.c b/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
index 72e5638ae..6f18abf83 100644
cf6bdb
--- a/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
+++ b/src/OVAL/probes/independent/yamlfilecontent_probe.c
cf6bdb
@@ -359,6 +359,7 @@ static int process_yaml_file(const char *prefix, const char *path, const char *f
cf6bdb
 			}
cf6bdb
 			oscap_htable_iterator_free(record_it);
cf6bdb
 			SEXP_list_add(item, result_ent);
cf6bdb
+			SEXP_free(result_ent);
cf6bdb
 		}
cf6bdb
 		probe_item_collect(ctx, item);
cf6bdb
 	}