Exemple #1
0
int app_xccdf_xslt(const struct oscap_action *action)
{
	const char *oval_template = action->oval_template;

	if (action->module == &XCCDF_GEN_REPORT && oval_template == NULL) {
		/* If generating the report and the option is missing -> use defaults */
		struct oscap_source *xccdf_source = oscap_source_new_from_file(action->f_xccdf);
		if (_some_oval_result_exists(xccdf_source))
			/* We want to define default template because we strive to serve user the
			 * best. However, we must not offer a template, if there is a risk it might
			 * be incorrect. Otherwise, libxml2 will throw a lot of misleading messages
			 * to stderr. */
			oval_template = "%.result.xml";
		oscap_source_free(xccdf_source);
	}

	if (action->module == &XCCDF_GEN_CUSTOM) {
	        action->module->user = (void*)action->stylesheet;
	}

	const char *params[] = {
		"result-id",         action->id,
		"show",              action->show,
		"profile_id",        action->profile,
		"template",          action->tmpl,
		"oval-template",     oval_template,
		"sce-template",      action->sce_template,
		"verbosity",         "",
		"hide-profile-info", action->hide_profile_info ? "yes" : NULL,
		NULL
	};

	int ret = app_xslt(action->f_xccdf, action->module->user, action->f_results, params);
	return ret;
}
Exemple #2
0
static int app_oval_xslt(const struct oscap_action *action)
{
    assert(action->module->user);
    return app_xslt(action->f_oval, action->module->user, action->f_results, NULL);
}
Exemple #3
0
static int oval_gen_report(const char *infile, const char *outfile)
{
    return app_xslt(infile, "oval-results-report.xsl", outfile, NULL);
}