[Open-scap] [PATCH] New command line option: --custom-stylesheet

Martin Preisler mpreisle at redhat.com
Wed Apr 4 11:53:26 UTC 2012


Hi,
your patch has been committed in a slightly reworked form. Thanks for your contribution!

http://git.fedorahosted.org/git/?p=openscap.git;a=commit;h=d61f2146e1407c859c4116697ba132e6b88359f3

I changed the new CLI syntax from "oscap xccdf generate {guide,report,fix} --with-stylesheet some.xslt some.xccdf" to "oscap xccdf generate custom --stylesheet some.xslt some.xccdf". The reason for this is that it's confusing that guide, report and fix do the same thing in case you override the behaviour with a custom stylesheet.

----- Original Message -----
> From: "Maura Dailey" <maura at eclipse.ncsc.mil>
> To: open-scap-list at redhat.com
> Sent: Wednesday, April 4, 2012 1:31:02 AM
> Subject: [Open-scap] [PATCH] New command line option: --custom-stylesheet
> 
> I created the attached patch that allows me to specify a custom XSL
> stylesheet when using the guide output option. After building the
> project with my patch applied, the new option --custom-stylesheet
> will
> either take an absolute path to an XSL file or will look for the file
> name inside OSCAP's installed xsl folder.
> 
> - I had some trouble with getting relative paths to work without
>   significantly rewriting oscap_find_file, so I abandoned the
>   attempt.

I have addressed this before committing the patch.

> - I also haven't solved the problem of sanitizing input (my filename
>   gets passed somewhat directly into oscap_find_file, which
>   automatically accepts any string that begins with '/' or '\\' as a
>   valid absolute path).

oscap will report that it can't parse the XSLT file. I admit that it's not an ideal error message.

> 
> I haven't submitted a patch for a public project before, so please
> excuse any ignorance on my part. I was hesitant to touch the code too
> much, lest I break other functionality.

Good work, not touching code unrelated to the change is preferred.

> 
> I also fixed one or two places with mismatched indenting that I came
> across while I worked on this patch. I didn't know if anything had
> been
> standardized for the project, so I made them match the surrounding
> lines in the function.
> 
> Thanks for your consideration,
> Maura Dailey
> maura at eclipse.ncsc.mil
> _______________________________________________
> Open-scap-list mailing list
> Open-scap-list at redhat.com
> https://www.redhat.com/mailman/listinfo/open-scap-list

-- 
Martin Preisler




More information about the Open-scap-list mailing list