[Open-scap] Patch for benchmark export support

Maros Barabas mbarabas at redhat.com
Tue May 11 10:54:21 UTC 2010


Hi Josh,

> Anyways, I've been working on adding export support for benchmarks and in
> the patch I submitted I've added full support for Groups and Rules.  I
> plan on implementing the rest, but wanted to get some feedback before I
> went further to make sure I'm headed in the right direction.
I've started to review your patch and the code is good. I have only two 
questions (correct me if I'm wrong):
1) Item type is abstract and the Item element should never appear in a valid 
XCCDF file, so there shouldn't be:
...
               case XCCDF_ITEM:
                       xmlNodeSetName(item_node,BAD_CAST "Item");
...
in xccdf_item_to_dom function. 

2) Is there any reason why you use:
...
if (xccdf_item_get_version(item)) {
                char version[10];
                *version = '\0';
                snprintf(version, sizeof(version), "%s", 
xccdf_item_get_version(item));
                xmlNewChild(item_node, ns_xccdf, BAD_CAST "version", BAD_CAST 
version);
        }
...
Version getters are implemented to return "const char *" so I suppose there 
should be only 
                xmlNewChild(item_node, ns_xccdf, BAD_CAST "version", BAD_CAST 
xccdf_item_get_version(item)),

shouldn't be ?



> I did run into one issue.  It seems that when descriptions and rationales
> (and a few other text fields) are parsed, they use the XCCDF_TEXT_HTML
> constant defined in src/XCCDF/item.c instead of XCCDF_TEXT_PLAINSUB.  This
> caused the output when exporting to be become messed up like:
> 
> <description><description
> xmlns="http://checklists.nist.gov/xccdf/1.1">Sudo privileges should
> granted or rejected to the wheel group as
> appropriate</description></description>
I will take a look at this.

Goog work !

Thanks,
Maros




More information about the Open-scap-list mailing list