krb5 commit: 'Destroy tickets on exit' destroys all tickets

Benjamin Kaduk kaduk at MIT.EDU
Wed Aug 29 12:50:45 EDT 2012


https://github.com/krb5/krb5/commit/cc96011e055131c81f224e126260f25c5318d97b
commit cc96011e055131c81f224e126260f25c5318d97b
Author: Kevin Wasserman <kevin.wasserman at painless-security.com>
Date:   Mon Jul 16 14:22:23 2012 -0400

    'Destroy tickets on exit' destroys all tickets
    
    Previously destroyed only default ccache and used obsolete functions.
    
    Signed-off-by: Kevin Wasserman <kevin.wasserman at painless-security.com>
    
    ticket: 7304 (new)
    queue: kfw
    target_version: 1.10.4
    tags: pullup

 src/windows/leash/LeashView.cpp |   19 +++++++------------
 1 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/src/windows/leash/LeashView.cpp b/src/windows/leash/LeashView.cpp
index 881d5c1..83134e4 100644
--- a/src/windows/leash/LeashView.cpp
+++ b/src/windows/leash/LeashView.cpp
@@ -1947,22 +1947,17 @@ VOID CLeashView::ResetTreeNodes()
 
 VOID CLeashView::OnDestroy()
 {
+    CCacheDisplayData *elem;
     SetTrayIcon(NIM_DELETE);
 
-    CListView::OnDestroy();
-    if (WaitForSingleObject( ticketinfo.lockObj, INFINITE ) != WAIT_OBJECT_0)
-        throw("Unable to lock ticketinfo");
-    BOOL b_destroy = m_destroyTicketsOnExit && ticketinfo.Krb5.btickets;
-    ReleaseMutex(ticketinfo.lockObj);
-
-    if (b_destroy)
-    {
-        if (pLeash_kdestroy())
-        {
-            AfxMessageBox("There is a problem destroying tickets!",
-                       MB_OK|MB_ICONSTOP);
+    if (m_destroyTicketsOnExit) {
+        elem = m_ccacheDisplay;
+        while (elem != NULL) {
+            kdestroy(elem->m_ccacheName);
+            elem = elem->m_next;
         }
     }
+    CListView::OnDestroy();
 }
 
 VOID CLeashView::OnUpdateDestroyTicket(CCmdUI* pCmdUI)


More information about the cvs-krb5 mailing list