From 44d0e52f6dbb8b095956babf1c8b7734219de01f Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Thu, 8 Dec 2005 06:58:15 +0000 Subject: [PATCH] Network Identity Manager - Fix module loading when en_US locale cannot be loaded The identity manager is designed for internationalization. However, it only ships with modules for the en_US locale. Designing modules for other locales was beyond our the reach of available resources. This patch will force the use of en_US when modules matching the installed user and system locales cannot be found. ticket: new status: resolved target_version: 1.4.4 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17555 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/identity/kmm/kmm_module.c | 29 ++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/windows/identity/kmm/kmm_module.c b/src/windows/identity/kmm/kmm_module.c index 25da22345..d5a61c740 100644 --- a/src/windows/identity/kmm/kmm_module.c +++ b/src/windows/identity/kmm/kmm_module.c @@ -208,12 +208,15 @@ kmmint_read_module_info(kmm_module_i * m) { } n_languages = (int) (cb / sizeof(*languages)); + + /* Try searching for the user's default language first */ lang = GetUserDefaultLangID(); for (i = 0; i < n_languages; i++) { if(languages[i].language == lang) break; } + /* If not, try the system default */ if (i >= n_languages) { lang = GetSystemDefaultLangID(); for (i=0; i= n_languages) { + lang = MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US); + for (i=0; i= n_languages) { + lang = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL); + for (i=0; i= n_languages) { + i = 0; + } + if (i >= n_languages) { rv = KHM_ERROR_INVALID_PARAM; _report_mr0(KHERR_WARNING, MSG_RMI_NO_LOCAL); @@ -247,7 +271,6 @@ kmmint_read_module_info(kmm_module_i * m) { _report_mr1(KHERR_WARNING, MSG_RMI_RES_TOO_LONG, _cstr(TEXT(NIMV_MODULE))); goto _cleanup; - } if (wcscmp(r, m->name)) { @@ -580,8 +603,8 @@ kmm_release_module_info_i(kmm_module_info * info) { KHMEXP khm_int32 KHMAPI -kmm_unload_module(kmm_module module) -{ +kmm_unload_module(kmm_module module) { + if(!kmm_is_module(module)) return KHM_ERROR_INVALID_PARAM; -- 2.26.2