Use LsaDeregisterLogonProcess(), not CloseHandle()
authorSam Hartman <hartmans@mit.edu>
Fri, 2 Dec 2011 19:20:54 +0000 (19:20 +0000)
committerSam Hartman <hartmans@mit.edu>
Fri, 2 Dec 2011 19:20:54 +0000 (19:20 +0000)
Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
ticket: 7037
target_version: 1.10
tags: pullup

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25499 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/cc_mslsa.c

index 9e9d27134e0d6654b6778e7d6903c74b75290fec..098ba29c6b86e42e19e6a23f70dc43f846fda46c 100644 (file)
@@ -668,7 +668,7 @@ does_retrieve_ticket_cache_ticket (void)
 
         pTicketRequest = (PKERB_RETRIEVE_TKT_REQUEST) LocalAlloc(LMEM_ZEROINIT, RequestSize);
         if (!pTicketRequest) {
-            CloseHandle(LogonHandle);
+            LsaDeregisterLogonProcess(LogonHandle);
             return FALSE;
         }
 
@@ -693,7 +693,7 @@ does_retrieve_ticket_cache_ticket (void)
         );
 
         LocalFree(pTicketRequest);
-        CloseHandle(LogonHandle);
+        LsaDeregisterLogonProcess(LogonHandle);
 
         if (FAILED(Status) || FAILED(SubStatus)) {
             if ( SubStatus == STATUS_NOT_SUPPORTED )
@@ -733,7 +733,7 @@ does_query_ticket_cache_ex2 (void)
 
         pCacheRequest = (PKERB_QUERY_TKT_CACHE_REQUEST) LocalAlloc(LMEM_ZEROINIT, RequestSize);
         if (!pCacheRequest) {
-            CloseHandle(LogonHandle);
+            LsaDeregisterLogonProcess(LogonHandle);
             return FALSE;
         }
 
@@ -751,7 +751,7 @@ does_query_ticket_cache_ex2 (void)
         );
 
         LocalFree(pCacheRequest);
-        CloseHandle(LogonHandle);
+        LsaDeregisterLogonProcess(LogonHandle);
 
         if (!(FAILED(Status) || FAILED(SubStatus))) {
             LsaFreeReturnBuffer(pCacheResponse);
@@ -2048,7 +2048,7 @@ krb5_lcc_resolve (krb5_context context, krb5_ccache *id, const char *residual)
 
     lid = (krb5_ccache) malloc(sizeof(struct _krb5_ccache));
     if (lid == NULL) {
-        CloseHandle(LogonHandle);
+        LsaDeregisterLogonProcess(LogonHandle);
         return KRB5_CC_NOMEM;
     }
 
@@ -2057,7 +2057,7 @@ krb5_lcc_resolve (krb5_context context, krb5_ccache *id, const char *residual)
     lid->data = (krb5_pointer) malloc(sizeof(krb5_lcc_data));
     if (lid->data == NULL) {
         free(lid);
-        CloseHandle(LogonHandle);
+        LsaDeregisterLogonProcess(LogonHandle);
         return KRB5_CC_NOMEM;
     }
 
@@ -2071,7 +2071,7 @@ krb5_lcc_resolve (krb5_context context, krb5_ccache *id, const char *residual)
     if (data->cc_name == NULL) {
         free(lid->data);
         free(lid);
-        CloseHandle(LogonHandle);
+        LsaDeregisterLogonProcess(LogonHandle);
         return KRB5_CC_NOMEM;
     }
     strcpy(data->cc_name, residual);
@@ -2093,7 +2093,7 @@ krb5_lcc_resolve (krb5_context context, krb5_ccache *id, const char *residual)
         free(data->cc_name);
         free(lid->data);
         free(lid);
-        CloseHandle(LogonHandle);
+        LsaDeregisterLogonProcess(LogonHandle);
         return KRB5_FCC_NOFILE;
     }
 
@@ -2168,7 +2168,7 @@ krb5_lcc_close(krb5_context context, krb5_ccache id)
         data = (krb5_lcc_data *) id->data;
 
         if (data) {
-            CloseHandle(data->LogonHandle);
+            LsaDeregisterLogonProcess(data->LogonHandle);
             free(data);
         }
         free(id);