summaryrefslogtreecommitdiffstats
path: root/src/windows/leashdll
diff options
context:
space:
mode:
authorKevin Wasserman <kevin.wasserman@painless-security.com>2012-06-08 08:06:01 -0400
committerBen Kaduk <kaduk@mit.edu>2012-08-24 15:54:50 -0400
commit1b80ae9b2c18a25447372871c48aecd17809e022 (patch)
tree4296cea0e957a83d6b3ec95352f0e411cda17fac /src/windows/leashdll
parent58441c9c61f332315c8b68dc63e352426a6d7707 (diff)
downloadkrb5-1b80ae9b2c18a25447372871c48aecd17809e022.tar.gz
krb5-1b80ae9b2c18a25447372871c48aecd17809e022.tar.xz
krb5-1b80ae9b2c18a25447372871c48aecd17809e022.zip
Add Forget Principals to Get Tickets dialog
And remove remnants of it from the "more" panel. Clear the registry key that stores the principal list. Also clear the autocomplete strings on the active control. [kaduk@mit.edu: squashed commits and rewrote commit message.] ticket: 7269 (new) subject: forget principals functionality queue: kfw target_version: 1.10.4 tags: pullup
Diffstat (limited to 'src/windows/leashdll')
-rw-r--r--src/windows/leashdll/leashids.h1
-rw-r--r--src/windows/leashdll/leashw32.def2
-rw-r--r--src/windows/leashdll/lsh_pwd.c9
-rw-r--r--src/windows/leashdll/lsh_pwd.rc3
-rw-r--r--src/windows/leashdll/lshutil.cpp25
5 files changed, 34 insertions, 6 deletions
diff --git a/src/windows/leashdll/leashids.h b/src/windows/leashdll/leashids.h
index 64c8641cbf..7a8718ee42 100644
--- a/src/windows/leashdll/leashids.h
+++ b/src/windows/leashdll/leashids.h
@@ -108,6 +108,7 @@
#define IDC_STATIC_NOTICE 1089
#define IDC_STATIC_RENEW 1090
#define IDD_PASSWORD 1091
+#define IDC_BUTTON_CLEAR_HISTORY 1092
#define IDC_EDIT_PASSWORD2 1192
#define IDC_STATIC_PWD2 1193
#define IDC_EDIT_PASSWORD3 1194
diff --git a/src/windows/leashdll/leashw32.def b/src/windows/leashdll/leashw32.def
index 5df8309ae4..75371741b2 100644
--- a/src/windows/leashdll/leashw32.def
+++ b/src/windows/leashdll/leashw32.def
@@ -106,4 +106,4 @@ EXPORTS
not_an_API_LeashKRB4GetTickets
not_an_API_LeashGetTimeServerName
not_an_API_Leash_AcquireInitialTicketsIfNeeded
- not_an_API_LeashKRB5FreeTickets
+ not_an_API_LeashKRB5FreeTickets \ No newline at end of file
diff --git a/src/windows/leashdll/lsh_pwd.c b/src/windows/leashdll/lsh_pwd.c
index e62cf5c3b6..06b7a69d3f 100644
--- a/src/windows/leashdll/lsh_pwd.c
+++ b/src/windows/leashdll/lsh_pwd.c
@@ -1428,6 +1428,7 @@ AdjustOptions(HWND hDialog, int show, int hideDiff)
ShowWindow(GetDlgItem(hDialog,IDC_CHECK_NOADDRESS),show);
ShowWindow(GetDlgItem(hDialog,IDC_CHECK_RENEWABLE),show);
ShowWindow(GetDlgItem(hDialog,IDC_STATIC_KRB5),show);
+ ShowWindow(GetDlgItem(hDialog,IDC_BUTTON_CLEAR_HISTORY),show);
GetWindowRect( hDialog, &dlgRect );
diff = dlgRect.top + GetSystemMetrics(SM_CYCAPTION)
@@ -1453,14 +1454,15 @@ AdjustOptions(HWND hDialog, int show, int hideDiff)
dlgRect.bottom-dlgRect.top+(show ? 1 : - 1) * hideDiff,
SWP_NOZORDER|SWP_NOMOVE);
- CSetDlgItemText(hDialog, IDC_BUTTON_OPTIONS, show ?
- "Hide Advanced Settings" : "Show Advanced Settings");
+ CSetDlgItemText(hDialog, IDC_BUTTON_OPTIONS,
+ show ? "Hide Advanced" : "Show Advanced");
}
extern void *lacInit(HWND hEditCtl);
extern void lacTerm(void *pAutoComplete);
extern void lacAddPrincipal(char *principal);
+extern void Leash_pec_clear_history(void *pec);
/* Callback function for the Authentication Dialog box that initializes and
renews tickets. */
@@ -1719,6 +1721,9 @@ AuthenticateProc(
}
break;
+ case IDC_BUTTON_CLEAR_HISTORY:
+ Leash_pec_clear_history(pAutoComplete);
+ break;
case IDC_CHECK_RENEWABLE:
{
if (IsDlgButtonChecked(hDialog, IDC_CHECK_RENEWABLE)) {
diff --git a/src/windows/leashdll/lsh_pwd.rc b/src/windows/leashdll/lsh_pwd.rc
index cfdcdb122e..7941ce2c0f 100644
--- a/src/windows/leashdll/lsh_pwd.rc
+++ b/src/windows/leashdll/lsh_pwd.rc
@@ -102,7 +102,8 @@ BEGIN
ES_AUTOHSCROLL
DEFPUSHBUTTON "OK",IDOK,302,219,49,14
PUSHBUTTON "Cancel",IDCANCEL,249,219,49,14
- PUSHBUTTON "Hide Advanced Settings",IDC_BUTTON_OPTIONS,146,219,89,14
+ PUSHBUTTON "Hide Advanced",IDC_BUTTON_OPTIONS,146,219,89,14
+ PUSHBUTTON "Clear Principal History",IDC_BUTTON_CLEAR_HISTORY,13,203,120,14
CONTROL "Ticket Lifetime",IDC_SLIDER_LIFETIME,"msctls_trackbar32",
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,90,97,258,15
CONTROL "Forwardable (can be forwarded to other machines)",
diff --git a/src/windows/leashdll/lshutil.cpp b/src/windows/leashdll/lshutil.cpp
index 2061e9374c..93383fa799 100644
--- a/src/windows/leashdll/lshutil.cpp
+++ b/src/windows/leashdll/lshutil.cpp
@@ -162,6 +162,11 @@ public:
virtual ~DynEnumString()
{
+ RemoveAll();
+ }
+
+ void RemoveAll()
+ {
for (m_iter = m_aStrings.begin();
m_iter != m_aStrings.end();
m_iter++)
@@ -354,6 +359,7 @@ public:
,m_bUpperCaseRealm(bUpperCaseRealm)
,m_defaultRealm(NULL)
,m_ctx(0)
+ ,m_enumString(NULL)
,m_acdd(NULL)
,m_princStr(NULL)
{
@@ -373,6 +379,18 @@ public:
pkrb5_free_context(m_ctx);
}
+ void ClearHistory()
+ {
+ if (m_enumString != NULL)
+ m_enumString->RemoveAll();
+ if (m_acdd != NULL)
+ m_acdd->ResetEnumerator();
+ if (m_princStr != NULL) {
+ delete[] m_princStr;
+ m_princStr = NULL;
+ }
+ }
+
protected:
// Convert str to upper case
// This should be more-or-less _UNICODE-agnostic
@@ -565,10 +583,13 @@ extern "C" void lacAddPrincipal(char *principal)
RegCloseKey(hKey);
}
-extern "C" void lacReset()
+extern "C" void Leash_pec_clear_history(void *pec)
{
// clear princs from registry
- //RegDeleteKeyEx()
+ RegDeleteKey(HKEY_CURRENT_USER,
+ LEASH_REGISTRY_PRINCIPALS_KEY_NAME);
+ // ...and from the specified widget
+ static_cast<PrincipalEditControl *>(pec)->ClearHistory();
}