From c02453daf72f95e0f90841ec7987a68c4286d55a Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Wed, 30 Nov 2005 16:06:00 +0000 Subject: [PATCH] Remove the case sensitive comparisions of registry entry and schema strings. Microsoft uses HKLM\"SOFTWARE" and HKCU\"Software". This means the encoding schema that was selected does not work and the conflict in case prevents plugins from being loaded. Better to enable plugins to work than to allow two realms that differ only by case on the same platform during the beta. ticket: 3253 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17523 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/identity/kconfig/api.c | 48 +++++++++++++++---- .../identity/kconfig/kconfiginternal.h | 2 +- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/src/windows/identity/kconfig/api.c b/src/windows/identity/kconfig/api.c index 39e72ecf5..41b6ccb11 100644 --- a/src/windows/identity/kconfig/api.c +++ b/src/windows/identity/kconfig/api.c @@ -260,7 +260,11 @@ khcint_RegOpenKeyEx(HKEY hkey, LPCWSTR sSubKey, DWORD ulOptions, goto _cleanup; } - if (!(wcsncmp(sk_name, t, cch))) { + /* FIX ME - This is not what we intended to do. We want + * a case sensitive match but we are running into a problem + * because of "HKLM\SOFTWARE" and "HKCU\Software" + */ + if (!(wcsnicmp(sk_name, t, cch))) { /* bingo! ?? */ if (cch < KCONF_MAXCCH_NAME && (sk_name[cch] == L'\0' || @@ -356,7 +360,11 @@ khcint_RegCreateKeyEx(HKEY hKey, if (l != ERROR_SUCCESS) break; - if (!(wcsncmp(sk_name, t, cch))) { + /* FIX ME - This is not what we intended to do. We want + * a case sensitive match but we are running into a problem + * because of "HKLM\SOFTWARE" and "HKCU\Software" + */ + if (!(wcsnicmp(sk_name, t, cch))) { /* bingo! ?? */ if (sk_name[cch] == L'\0' || sk_name[cch] == L'~') { @@ -594,7 +602,11 @@ khcint_open_space_int(kconf_conf_space * parent, EnterCriticalSection(&cs_conf_global); c = TFIRSTCHILD(p); while(c) { - if(c->name && !wcscmp(c->name, buf)) + /* FIX ME - This is not what we intended to do. We want + * a case sensitive match but we are running into a problem + * because of "HKLM\SOFTWARE" and "HKCU\Software" + */ + if(c->name && !wcsicmp(c->name, buf)) break; c = LNEXT(c); @@ -887,7 +899,11 @@ khc_read_string(khm_handle pconf, if(c->schema && khc_is_schema_handle(conf)) { for(i=0;inSchema;i++) { - if(c->schema[i].type == KC_STRING && !wcscmp(value, c->schema[i].name)) { + /* FIX ME - This is not what we intended to do. We want + * a case sensitive match but we are running into a problem + * because of "HKLM\SOFTWARE" and "HKCU\Software" + */ + if(c->schema[i].type == KC_STRING && !wcsicmp(value, c->schema[i].name)) { /* found it */ size_t cbsize = 0; @@ -1032,7 +1048,11 @@ khc_read_int32(khm_handle pconf, wchar_t * pvalue, khm_int32 * buf) { if(c->schema && khc_is_schema_handle(conf)) { for(i=0;inSchema;i++) { - if(c->schema[i].type == KC_INT32 && !wcscmp(value, c->schema[i].name)) { + /* FIX ME - This is not what we intended to do. We want + * a case sensitive match but we are running into a problem + * because of "HKLM\SOFTWARE" and "HKCU\Software" + */ + if(c->schema[i].type == KC_INT32 && !wcsicmp(value, c->schema[i].name)) { *buf = (khm_int32) c->schema[i].value; rv = KHM_ERROR_SUCCESS; goto _exit; @@ -1151,7 +1171,11 @@ khc_read_int64(khm_handle pconf, wchar_t * pvalue, khm_int64 * buf) { if(c->schema && khc_is_schema_handle(conf)) { for(i=0;inSchema;i++) { - if(c->schema[i].type == KC_INT64 && !wcscmp(value, c->schema[i].name)) { + /* FIX ME - This is not what we intended to do. We want + * a case sensitive match but we are running into a problem + * because of "HKLM\SOFTWARE" and "HKCU\Software" + */ + if(c->schema[i].type == KC_INT64 && !wcsicmp(value, c->schema[i].name)) { *buf = (khm_int64) c->schema[i].value; rv = KHM_ERROR_SUCCESS; goto _exit; @@ -1675,7 +1699,11 @@ khc_get_type(khm_handle conf, wchar_t * value) { int i; for(i=0; inSchema; i++) { - if(!wcscmp(c->schema[i].name, value)) { + /* FIX ME - This is not what we intended to do. We want + * a case sensitive match but we are running into a problem + * because of "HKLM\SOFTWARE" and "HKCU\Software" + */ + if(!wcsicmp(c->schema[i].name, value)) { return c->schema[i].type; } } @@ -1732,7 +1760,11 @@ khc_value_exists(khm_handle conf, wchar_t * value) { if(c->schema) { for(i=0; inSchema; i++) { - if(!wcscmp(c->schema[i].name, value)) { + /* FIX ME - This is not what we intended to do. We want + * a case sensitive match but we are running into a problem + * because of "HKLM\SOFTWARE" and "HKCU\Software" + */ + if(!wcsicmp(c->schema[i].name, value)) { rv |= KCONF_FLAG_SCHEMA; break; } diff --git a/src/windows/identity/kconfig/kconfiginternal.h b/src/windows/identity/kconfig/kconfiginternal.h index 6d5a63cbf..3a23af127 100644 --- a/src/windows/identity/kconfig/kconfiginternal.h +++ b/src/windows/identity/kconfig/kconfiginternal.h @@ -89,7 +89,7 @@ extern LONG conf_status; #define khc_is_config_running() (conf_init && conf_status) -#define CONFIG_REGPATHW L"Software\\MIT\\NetIDMgr" +#define CONFIG_REGPATHW L"SOFTWARE\\MIT\\NetIDMgr" void init_kconf(void); void exit_kconf(void); -- 2.26.2