[krbdev.mit.edu #5610] NIM password prompt does not identify itself
Kevin Koch via RT
rt at krbdev.mit.edu
Mon Sep 24 22:38:34 EDT 2007
Thanks for the reminder about the csv file.
C:\KfW\pismere\athena\auth\krb5\src\windows\identity>svn diff -x --
ignore-eol-style plugins\krb5\krbconfig.csv
Index: plugins/krb5/krbconfig.csv
===================================================================
--- plugins/krb5/krbconfig.csv (revision 19911)
+++ plugins/krb5/krbconfig.csv (working copy)
@@ -25,6 +25,8 @@
LRURealms,KC_STRING,,
LRUPrincipals,KC_STRING,,
LastDefaultIdent,KC_STRING,,Last known default identity
+ NameSpaceName,KC_STRING,,The name of the service NIM presents to
the user. Typically 'Kerberos ' if given at all. Prepended
to 'Username' in the NewCreds
Username input label
+ NewCredPromptText,KC_STRING,,The prompt sentence at the top of
the New Creds dialog
PromptCacheLifetime,KC_INT32,172800,Lifetime of the prompt cache
in seconds
DefaultCCName,KC_STRING,,Default CC name (only per identity)
DefaultToFileCache,KC_INT32,0,"If no DefaultCCName is specified
for an identity, use a generated FILE: cache instead of an API: cache"
C:\KfW\pismere\athena\auth\krb5\src\windows\identity>svn diff -x --
ignore-eol-style plugins\krb5\krb5identpro.c
Index: plugins/krb5/krb5identpro.c
===================================================================
--- plugins/krb5/krb5identpro.c (revision 19911)
+++ plugins/krb5/krb5identpro.c (working copy)
@@ -31,6 +31,7 @@
#include<strsafe.h>
#include<krb5.h>
#include<assert.h>
+#include <string.h>
#define K5_NCID_UN_LABEL (KHUI_CW_ID_MIN + 0)
#define K5_NCID_UN (KHUI_CW_ID_MIN + 1)
@@ -49,6 +50,8 @@
HWND hw_realm;
} k5_new_cred_data;
+#define IDC_ENTUNAME 1145 /* Hack! */
+
static
void
trim_str(wchar_t * s, khm_size cch) {
@@ -397,6 +400,7 @@
return FALSE;
}
+
/* UI Callback
runs in UI thread */
@@ -427,6 +431,12 @@
khm_int32 rv;
khm_handle hident;
+ khm_handle csp_pm = NULL;
+ wchar_t namespace[KCONF_MAXCCH_NAME];
+ khm_size cbsize;
+ wchar_t promptText[KCONF_MAXCCH_NAME];
+ HWND hw_prompt;
+
hw_parent = (HWND) lParam;
defident[0] = L'\0';
@@ -435,6 +445,19 @@
assert(hw_parent != NULL);
#endif
+ ZeroMemory(namespace, sizeof(namespace) * sizeof
(wchar_t));
+ ZeroMemory(promptText, sizeof(promptText) * sizeof
(wchar_t));
+ if (!KHM_FAILED(khc_open_space(NULL,
L"PluginManager\\Plugins\\Krb5Cred\\Parameters",
+ KHM_PERM_READ, &csp_pm))) {
+ cbsize = sizeof(namespace);
+ khc_read_string(csp_pm, L"NameSpaceName", namespace,
&cbsize);
+
+ cbsize = sizeof(promptText);
+ khc_read_string(csp_pm, L"NewCredPromptText",
promptText, &cbsize);
+
+ khc_close_space(csp_pm);
+ }
+
d = PMALLOC(sizeof(*d));
assert(d);
ZeroMemory(d, sizeof(*d));
@@ -446,10 +469,17 @@
LoadString(hResModule, IDS_NC_USERNAME,
wbuf, ARRAYLENGTH(wbuf));
+ /* Find and set IDC_ENTUNAME: */
+ hw_prompt = GetDlgItem(hw_parent, IDC_ENTUNAME);
+ if (hw_prompt) SendMessage(hw_prompt, WM_SETTEXT, 0,
(LPARAM)promptText);
+
+ /* Build up username prompt from NameSpaceName and
Username: */
+ wcsncat(namespace, wbuf, KCONF_MAXCCH_NAME);
+
d->hw_username_label = CreateWindow
(L"STATIC",
- wbuf,
- SS_SIMPLE | WS_CHILD | WS_VISIBLE,
+ namespace,
+ WS_CHILD | WS_VISIBLE,
0, 0, 100, 100, /* bogus values */
hw_parent,
(HMENU) K5_NCID_UN_LABEL,
@@ -713,6 +743,7 @@
WM_SETTEXT,
0,
(LPARAM) defident);
+
}
set_identity_from_ui(nc, d);
More information about the krb5-bugs
mailing list