Blame SOURCES/openscap-1.2.15-use-checklist-id-to-get-html-guide-PR-745.patch

160b6f
From e8f6f67552b196b9d65fa40719e2ea00c87a9579 Mon Sep 17 00:00:00 2001
160b6f
From: Evgeni Golov <egolov@redhat.com>
160b6f
Date: Fri, 19 May 2017 17:34:59 +0200
160b6f
Subject: [PATCH] pass session->checklist_id to oscap_htable_get in
160b6f
 get_html_guide
160b6f
160b6f
In b8defed we moved to using s->checklist_id instead of hard coding
160b6f
xccdf.xml. However, this change was forgotten in
160b6f
ds_sds_session_get_html_guide which leads to the following error when
160b6f
trying to get the HTML guide:
160b6f
160b6f
    Internal error: Could not acquire handle to xccdf.xml source.
160b6f
160b6f
This change migrates ds_sds_session_get_html_guide to also use
160b6f
s->checklist_id and thus fixes the issue.
160b6f
160b6f
Fixes: #744
160b6f
---
160b6f
 src/DS/ds_sds_session.c | 4 ++--
160b6f
 1 file changed, 2 insertions(+), 2 deletions(-)
160b6f
160b6f
diff --git a/src/DS/ds_sds_session.c b/src/DS/ds_sds_session.c
160b6f
index db7692a65..f14588e09 100644
160b6f
--- a/src/DS/ds_sds_session.c
160b6f
+++ b/src/DS/ds_sds_session.c
160b6f
@@ -352,9 +352,9 @@ char *ds_sds_session_get_html_guide(struct ds_sds_session *session, const char *
160b6f
 		"profile_id", profile_id,
160b6f
 		NULL
160b6f
 	};
160b6f
-	struct oscap_source *xccdf = oscap_htable_get(session->component_sources, "xccdf.xml");
160b6f
+	struct oscap_source *xccdf = oscap_htable_get(session->component_sources, session->checklist_id);
160b6f
 	if (xccdf == NULL) {
160b6f
-		oscap_seterr(OSCAP_EFAMILY_OSCAP, "Internal error: Could not acquire handle to xccdf.xml source.");
160b6f
+		oscap_seterr(OSCAP_EFAMILY_OSCAP, "Internal error: Could not acquire handle to '%s' source.", session->checklist_id);
160b6f
 		return NULL;
160b6f
 	}
160b6f
 	return oscap_source_apply_xslt_path_mem(xccdf, "xccdf-guide.xsl", params, oscap_path_to_xslt());