summaryrefslogtreecommitdiffstats
path: root/src/windows/leashdll/lshutil.cpp
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/lshutil.cpp
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/lshutil.cpp')
-rw-r--r--src/windows/leashdll/lshutil.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/windows/leashdll/lshutil.cpp b/src/windows/leashdll/lshutil.cpp
index 2061e9374..93383fa79 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();
}