Bug 466137 - htmladmin gives 500 error
Summary: htmladmin gives 500 error
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Directory Server
Classification: Red Hat
Component: UI - Admin Express
Version: 8.0
Hardware: All
OS: Other
medium
low
Target Milestone: ---
: ---
Assignee: Rich Megginson
QA Contact: Chandrasekar Kannan
URL:
Whiteboard:
Depends On:
Blocks: 249650 FDS1.2.0
TreeView+ depends on / blocked
 
Reported: 2008-10-08 16:56 UTC by Ulf Weltman
Modified: 2015-01-04 23:34 UTC (History)
3 users (show)

Fixed In Version: 8.1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-04-29 23:07:01 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
diffs (1.03 KB, patch)
2008-12-04 01:01 UTC, Rich Megginson
no flags Details | Diff
cvs commit log (167 bytes, text/plain)
2008-12-04 15:58 UTC, Rich Megginson
no flags Details

Description Ulf Weltman 2008-10-08 16:56:09 UTC
Point a browser to the admin server URL, click "Red Hat Administration Express" and authenticate, I end up at http://hptem080.cup.hp.com:9830/admin-serv/tasks/configuration/HTMLAdmin?op=index which gives a 500 error and this AS error log output:
"Premature end of script headers: htmladmin, referer: http://hptem080.cup.hp.com:9830/dist/download"

This happens on at least HP-UX 11.23 IA and PA with both RHDS 8.0.0 and 8.0.4.

Comment 1 Ulf Weltman 2008-10-09 00:21:02 UTC
A-ha, I got it running in a debugger and found it was having trouble getting a resource bundle from ICU.  Turns out the htmladmin uses adminsdk's res_getstring() with the acceptLanguage set to the raw string from the browser, which I still had set to "en-US,en,en-CA,en-us,EN-US,EN,es-ES,es,no-NO,no,en-gb,ro-RO,ro,utf-8,utf,de-DE" after testing the SP7 security stuff.  ICU chokes on that locale and returns U_ILLEGAL_ARGUMENT_ERROR.  Returning my intl.accept_languages to the default fixes it.

There is no crash when it fails to resolve the locale, htmladmin just prints nothing at all since all the resource string lookups return empty strings.

Comment 2 Rich Megginson 2008-12-03 23:28:11 UTC
It is the double quotes which is throwing it off.  That is, en-US,en,en-CA,en-us,EN-US,EN,es-ES,es,no-NO,no,en-gb,ro-RO,ro,utf-8,utf,de-DE will work, but not "en-US,en,en-CA,en-us,EN-US,EN,es-ES,es,no-NO,no,en-gb,ro-RO,ro,utf-8,utf,de-DE"

You cannot set the language string to something containing quotes with the regular Preferences->Languages Choose... dialog, you have to go to
about:config
and set intl.accept_languages to the above value.

Furthermore, the browser (or perhaps Apache) will parse and append the string before it gets to htmladmin, and the value will be
 "en-US,en;q=0.9,en-CA;q=0.9,en-us;q=0.8,EN-US;q=0.8,EN;q=0.7,es-ES;q=0.6,es;q=0.6,no-NO;q=0.5,no;q=0.4,en-gb;q=0.4,ro-RO;q=0.3,ro;q=0.3,utf-8;q=0.2,utf;q=0.1,de-DE";q=0.1

This is what I've found in my testing.  At any rate, it looks as though the fix is to handle U_ILLEGAL_ARGUMENT_ERROR, and just use the default language in that case.

Comment 3 Rich Megginson 2008-12-04 01:01:39 UTC
Created attachment 325619 [details]
diffs

Comment 4 Rich Megginson 2008-12-04 15:58:08 UTC
Created attachment 325699 [details]
cvs commit log

Reviewed by: nkinder (Thanks!)
Fix Description: If the locale string passed in to res_getstring is bogus, the CGI will just exit (no crash, no security problems) which causes the 500 error.  ures_open returns U_ILLEGAL_ARGUMENT_ERROR if the locale string is bogus.  In this case, just use NULL for the locale which will cause it to use the default one.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no

Comment 5 Jenny Severance 2009-03-13 18:53:50 UTC
fix verified - RHEL 5 - DS 8.1  Red Hat Administration Express available, able to view log and stop servers

Comment 6 Chandrasekar Kannan 2009-04-29 23:07:01 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-0455.html


Note You need to log in before you can comment on or make changes to this bug.