Bug 533054

Summary: exceptions ignore xml output parameter
Product: [Retired] Dogtag Certificate System Reporter: John Dennis <jdennis>
Component: Certificate ManagerAssignee: RHCS Maintainers <rhcs-maint>
Status: CLOSED EOL QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: low    
Version: 1.2CC: dpal, jgalipea, rcritten
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 20:05:47 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 431022, 533979    
Attachments:
Description Flags
patch none

Description John Dennis 2009-11-04 20:25:28 UTC
When a request is sent to the CMS server it can specify it wants an xml document as the result as opposed to HTML by setting the HTTP request arg xml=true.

In CMSServlet.renderTemplate() the xml flag is checked and if its set to true then it invokes CMSServlet.outputXML() instead of rendering an HTML template.

However CMSServlet.renderTemplate() is bypassed when an exception is caught. Instead in the exception catch block CMSServlet.renderExecption() is directly invoked bypassing the logic in CMSServlet.renderTemplate(). 

CMSServlet.renderExecption() fails to test for the xml output flag, as a consequence even though the client requested xml output instead of HTML, it gets HTML, a truly unanticipated response.

Comment 1 John Dennis 2009-11-12 16:07:18 UTC
Created attachment 369245 [details]
patch

Comment 2 Andrew Wnuk 2009-11-18 19:02:58 UTC
Did you intentionally ignore "xmlOutput" request parameter to provide XML output only if "xml" request parameter is set to true?

If no, then you are ignoring your own algorithm provided in bug #531940.
     (see: https://bugzilla.redhat.com/attachment.cgi?id=369228)
If yes, then your patch is fine.

Comment 3 John Dennis 2009-11-18 19:11:34 UTC
re comment #2 yes this was intentional. The use of "xmlOutput" parameter name is a singular aberration unique to profileSubmit, all other usage is consistently "xml". I'd be happy to see the xmlOutput exception eliminated for consistency sake but I assumed it was important to retain for backward compatibility reasons. Since IPA will have it's own branch perhaps this isn't valid rationale. If these patches make it back into the main CMS code base then this would be an issue.

Comment 4 Andrew Wnuk 2009-11-25 23:45:52 UTC
Patch included in in bug #533979 (attachment #373874 [details]) is committed.