Skip to content

Commit b88b330

Browse files
Merge pull request #2181 from jan-cerny/oscap_info_reduction
Reduce oscap info output
2 parents e4ddfc8 + 9917e9a commit b88b330

File tree

2 files changed

+5
-31
lines changed

2 files changed

+5
-31
lines changed

docs/manual/manual.adoc

-9
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,6 @@ Checklists:
198198
system: http://scap.nist.gov/schema/ocil/2
199199
security-data-oval-com.redhat.rhsa-RHEL8.xml
200200
system: http://oval.mitre.org/XMLSchema/oval-definitions-5
201-
Checks:
202-
Ref-Id: scap_org.open-scap_cref_ssg-rhel8-oval.xml
203-
Ref-Id: scap_org.open-scap_cref_ssg-rhel8-ocil.xml
204-
Ref-Id: scap_org.open-scap_cref_ssg-rhel8-cpe-oval.xml
205-
Ref-Id: scap_org.open-scap_cref_security-data-oval-com.redhat.rhsa-RHEL8.xml
206-
Dictionaries:
207-
Ref-Id: scap_org.open-scap_cref_ssg-rhel8-cpe-dictionary.xml
208201
----
209202

210203
* **Document type** describes what format the file is in. Common types include
@@ -225,8 +218,6 @@ shown for XCCDF files and Checklists and is sourced from the XCCDF **Status**
225218
element.
226219
* **Profiles** lists available profiles, their titles and IDs that you can use for
227220
the `--profile` command line attribute.
228-
* **Checks** and **Dictionaries** lists OVAL checks components and CPE
229-
dictionaries components in the given data stream.
230221

231222
To display more detailed information about a profile including the profile
232223
description, use the `--profile` option followed by the profile ID.

utils/oscap-info.c

+5-22
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,11 @@ static inline void _print_xccdf_referenced_files(struct xccdf_policy_model *poli
209209
printf("%sReferenced check files:\n", prefix);
210210
while (oscap_file_entry_iterator_has_more(files_it)) {
211211
struct oscap_file_entry *file_entry = (struct oscap_file_entry *) oscap_file_entry_iterator_next(files_it);
212-
printf("%s\t%s\n", prefix, oscap_file_entry_get_file(file_entry));
213-
printf("%s\t\tsystem: %s\n", prefix, oscap_file_entry_get_system(file_entry));
212+
const char *system = oscap_file_entry_get_system(file_entry);
213+
if (strcmp(system, "http://open-scap.org/page/SCE")) {
214+
printf("%s\t%s\n", prefix, oscap_file_entry_get_file(file_entry));
215+
printf("%s\t\tsystem: %s\n", prefix, oscap_file_entry_get_system(file_entry));
216+
}
214217
}
215218
oscap_file_entry_iterator_free(files_it);
216219
oscap_file_entry_list_free(referenced_files);
@@ -490,26 +493,6 @@ static int app_info_single_ds_all(struct ds_stream_index_iterator* sds_it, struc
490493
ds_sds_session_reset(session);
491494
}
492495
oscap_string_iterator_free(checklist_it);
493-
494-
printf("Checks:\n");
495-
struct oscap_string_iterator* checks_it = ds_stream_index_get_checks(stream);
496-
while (oscap_string_iterator_has_more(checks_it)) {
497-
const char * id = oscap_string_iterator_next(checks_it);
498-
printf("\tRef-Id: %s\n", id);
499-
}
500-
oscap_string_iterator_free(checks_it);
501-
502-
struct oscap_string_iterator* dict_it = ds_stream_index_get_dictionaries(stream);
503-
if (oscap_string_iterator_has_more(dict_it)) {
504-
printf("Dictionaries:\n");
505-
} else {
506-
printf("No dictionaries.\n");
507-
}
508-
while (oscap_string_iterator_has_more(dict_it)) {
509-
const char * id = oscap_string_iterator_next(dict_it);
510-
printf("\tRef-Id: %s\n", id);
511-
}
512-
oscap_string_iterator_free(dict_it);
513496
return OSCAP_OK;
514497
}
515498

0 commit comments

Comments
 (0)