[Open-scap] Patch for benchmark export support
Joshua Adams
jadams at tresys.com
Tue May 11 14:19:08 UTC 2010
Thanks for the help.
I've made the suggested changes and added support for Values in the attached patch.
Josh Adams
-----Original Message-----
From: Maros Barabas [mailto:mbarabas at redhat.com]
Sent: Tue 5/11/2010 6:54 AM
To: Joshua Adams
Cc: open-scap-list at redhat.com
Subject: Re: [Open-scap] Patch for benchmark export support
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-support-for-exporting-Values.patch
Type: application/octet-stream
Size: 6321 bytes
Desc: 0001-Add-support-for-exporting-Values.patch
URL: <http://listman.redhat.com/archives/open-scap-list/attachments/20100511/aef63142/attachment.obj>
More information about the Open-scap-list
mailing list