From f3f60af8b0b242fb266fbb3f127ebd3c5acce606 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 23 Aug 2006 18:31:44 +0000 Subject: [PATCH] pull up r18497 from trunk r18497@cathode-dark-space: jaltman | 2006-08-22 22:18:00 -0400 ticket: 4172 * newcredwnd.c - erase the password field on error during new credential acquisition ticket: 4172 version_fixed: 1.4.4 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-4@18504 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/identity/ui/newcredwnd.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/windows/identity/ui/newcredwnd.c b/src/windows/identity/ui/newcredwnd.c index a12942a15..1c5d19412 100644 --- a/src/windows/identity/ui/newcredwnd.c +++ b/src/windows/identity/ui/newcredwnd.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2005 Massachusetts Institute of Technology + * Copyright (c) 2006 Secure Endpoints Inc. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -239,6 +240,30 @@ nc_notify_types(khui_new_creds * c, UINT uMsg, } } +static void +nc_clear_password_fields(khui_nc_wnd_data * d) +{ + khm_size i; + khm_boolean need_sync = FALSE; + + khui_cw_lock_nc(d->nc); + + for (i=0; i < d->nc->n_prompts; i++) { + if ((d->nc->prompts[i]->flags & KHUI_NCPROMPT_FLAG_HIDDEN) && + d->nc->prompts[i]->hwnd_edit) { + SetWindowText(d->nc->prompts[i]->hwnd_edit, + L""); + need_sync = TRUE; + } + } + + khui_cw_unlock_nc(d->nc); + + if (need_sync) { + khui_cw_sync_prompt_values(d->nc); + } +} + #define NC_MAXCCH_CREDTEXT 16384 #define NC_MAXCB_CREDTEXT (NC_MAXCCH_CREDTEXT * sizeof(wchar_t)) @@ -271,7 +296,6 @@ nc_update_credtext(khui_nc_wnd_data * d) khm_size cbbuf; khm_int32 flags; - LoadString(khm_hInstance, IDS_NC_CREDTEXT_ID_ONE, main_fmt, (int) ARRAYLENGTH(main_fmt)); @@ -1674,6 +1698,8 @@ static LRESULT nc_handle_wm_nc_notify(HWND hwnd, hw = GetDlgItem(d->dlg_bb, IDCANCEL); EnableWindow(hw, TRUE); + nc_clear_password_fields(d); + return TRUE; } -- 2.26.2