[krbdev.mit.edu #5610] NIM password prompt does not identify itself

asanka@mit.edu via RT rt at krbdev.mit.edu
Mon Sep 24 17:10:21 EDT 2007


> This patch solves the titlebar problem by putting the explanatory
> prompt in the dialog.  It uses two registry settings:
> 
> PluginManager/NameSpaceName:  The word 'Kerberos' which is prepended
> to the Username input label.
> 
> PluginManager/NewCredPromptText: 'Enter your Kerberos password.'
> 
> Either registry entry can be omitted.

Since these settings are specific to the Kerberos 5 plug-in, they should
go under  PluginManager/Plugins/Krb5Cred/Parameters .  Note that both
Krb5Ident and Krb5Cred plug-ins share the same configuration space since
they use the same configuration settings.

> plugins\krb5\krb5identpro.c
> Index: plugins/krb5/krb5identpro.c
> ===================================================================
...
> @@ -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);
...

The labels used for password prompting are provided by the Kerberos 5
plug-in.  If you want to change the text of these labels, you should do
so at k5_kinit_prompter() and k5_cached_kinit_prompter() in
krb5newcreds.c before the label text is provided to NIM.

Doing it this way can cause problems for a few reasons.  The control IDs
for controls in the new credentials dialog can change.  Also, the
plug-in doesn't always know that what it's prompting for is a password,
which is why we use the prompt string provided by the KDC.

If the registry settings are optional, you should check for their
existence before using their values.  The code seems to assume they
always exist.

> khapp.rc was editted with Visual Studio so the line wraps are
> different.  A prompt line was added to the new credentials dialog and
> the BBAR OK button was made the same height as the other buttons.  svn
> diff crashes.

I sometimes use Visual Studio for editing the .rc files as well.  You'll
have to use something else to fix line endings after saving the files
with VS.

- Asanka Herath
Secure-Endpoints Inc.



More information about the krb5-bugs mailing list