Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce oscap info output #2181

Open
wants to merge 1 commit into
base: maint-1.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions docs/manual/manual.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,6 @@ Checklists:
system: http://scap.nist.gov/schema/ocil/2
security-data-oval-com.redhat.rhsa-RHEL8.xml
system: http://oval.mitre.org/XMLSchema/oval-definitions-5
Checks:
Ref-Id: scap_org.open-scap_cref_ssg-rhel8-oval.xml
Ref-Id: scap_org.open-scap_cref_ssg-rhel8-ocil.xml
Ref-Id: scap_org.open-scap_cref_ssg-rhel8-cpe-oval.xml
Ref-Id: scap_org.open-scap_cref_security-data-oval-com.redhat.rhsa-RHEL8.xml
Dictionaries:
Ref-Id: scap_org.open-scap_cref_ssg-rhel8-cpe-dictionary.xml
----

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

To display more detailed information about a profile including the profile
description, use the `--profile` option followed by the profile ID.
Expand Down
27 changes: 5 additions & 22 deletions utils/oscap-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,11 @@ static inline void _print_xccdf_referenced_files(struct xccdf_policy_model *poli
printf("%sReferenced check files:\n", prefix);
while (oscap_file_entry_iterator_has_more(files_it)) {
struct oscap_file_entry *file_entry = (struct oscap_file_entry *) oscap_file_entry_iterator_next(files_it);
printf("%s\t%s\n", prefix, oscap_file_entry_get_file(file_entry));
printf("%s\t\tsystem: %s\n", prefix, oscap_file_entry_get_system(file_entry));
const char *system = oscap_file_entry_get_system(file_entry);
if (strcmp(system, "http://open-scap.org/page/SCE")) {
printf("%s\t%s\n", prefix, oscap_file_entry_get_file(file_entry));
printf("%s\t\tsystem: %s\n", prefix, oscap_file_entry_get_system(file_entry));
}
}
oscap_file_entry_iterator_free(files_it);
oscap_file_entry_list_free(referenced_files);
Expand Down Expand Up @@ -490,26 +493,6 @@ static int app_info_single_ds_all(struct ds_stream_index_iterator* sds_it, struc
ds_sds_session_reset(session);
}
oscap_string_iterator_free(checklist_it);

printf("Checks:\n");
struct oscap_string_iterator* checks_it = ds_stream_index_get_checks(stream);
while (oscap_string_iterator_has_more(checks_it)) {
const char * id = oscap_string_iterator_next(checks_it);
printf("\tRef-Id: %s\n", id);
}
oscap_string_iterator_free(checks_it);

struct oscap_string_iterator* dict_it = ds_stream_index_get_dictionaries(stream);
if (oscap_string_iterator_has_more(dict_it)) {
printf("Dictionaries:\n");
} else {
printf("No dictionaries.\n");
}
while (oscap_string_iterator_has_more(dict_it)) {
const char * id = oscap_string_iterator_next(dict_it);
printf("\tRef-Id: %s\n", id);
}
oscap_string_iterator_free(dict_it);
return OSCAP_OK;
}

Expand Down
Loading