diff options
author | Graham Leggett <minfrin@apache.org> | 2018-02-16 12:37:30 +0000 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2018-02-16 12:37:30 +0000 |
commit | ed789bf5c1874f60ee639d85e89e1f59e3d9f16e (patch) | |
tree | 5d625d5b2fcc24d4c67b9e860a9c0c246b215958 | |
parent | 0d4caaa46c480b957bad2aad28d9abacf69e22c0 (diff) | |
download | httpd-ed789bf5c1874f60ee639d85e89e1f59e3d9f16e.tar.gz |
mod_authnz_ldap: Fix language long names detection as short name.
trunk patch: http://svn.apache.org/r1824336
+1: ylavic, elukey, rpluem
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1824456 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | STATUS | 5 | ||||
-rw-r--r-- | modules/aaa/mod_authnz_ldap.c | 10 |
3 files changed, 10 insertions, 8 deletions
@@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.4.30 + *) mod_authnz_ldap: Fix language long names detection as short name. + [Yann Ylavic] + *) mod_proxy: Worker schemes and hostnames which are too large are no longer fatal errors; it is logged and the truncated values are stored. [Jim Jagielski] @@ -118,11 +118,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - *) mod_authnz_ldap: Fix language long names detection as short name. - trunk patch: http://svn.apache.org/r1824336 - 2.4.x patch: trunk works (modulo CHANGES) - +1: ylavic, elukey, rpluem - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/modules/aaa/mod_authnz_ldap.c b/modules/aaa/mod_authnz_ldap.c index 8cee7d47b1..98c48a8609 100644 --- a/modules/aaa/mod_authnz_ldap.c +++ b/modules/aaa/mod_authnz_ldap.c @@ -126,9 +126,13 @@ static char* derive_codepage_from_lang (apr_pool_t *p, char *language) charset = (char*) apr_hash_get(charset_conversions, language, APR_HASH_KEY_STRING); - if (!charset) { - language[2] = '\0'; - charset = (char*) apr_hash_get(charset_conversions, language, APR_HASH_KEY_STRING); + /* + * Test if language values like 'en-US' return a match from the charset + * conversion map when shortened to 'en'. + */ + if (!charset && strlen(language) > 3 && language[2] == '-') { + char *language_short = apr_pstrndup(p, language, 2); + charset = (char*) apr_hash_get(charset_conversions, language_short, APR_HASH_KEY_STRING); } if (charset) { |