Bug 466137 - htmladmin gives 500 error
htmladmin gives 500 error
Status: CLOSED CURRENTRELEASE
Product: Red Hat Directory Server
Classification: Red Hat
Component: UI - Admin Express (Show other bugs)
8.0
All Other
medium Severity low
: ---
: ---
Assigned To: Rich Megginson
Chandrasekar Kannan
:
Depends On:
Blocks: 249650 FDS1.2.0
  Show dependency treegraph
 
Reported: 2008-10-08 12:56 EDT by Ulf Weltman
Modified: 2015-01-04 18:34 EST (History)
3 users (show)

See Also:
Fixed In Version: 8.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-29 19:07:01 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Ulf Weltman 2008-10-08 12:56:09 EDT
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-08 20:21:02 EDT
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 18:28:11 EST
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-03 20:01:39 EST
Created attachment 325619 [details]
diffs
Comment 4 Rich Megginson 2008-12-04 10:58:08 EST
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 Galipeau 2009-03-13 14:53:50 EDT
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 19:07:01 EDT
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.