pull up r17440 from trunk
authorTom Yu <tlyu@mit.edu>
Thu, 20 Oct 2005 22:43:29 +0000 (22:43 +0000)
committerTom Yu <tlyu@mit.edu>
Thu, 20 Oct 2005 22:43:29 +0000 (22:43 +0000)
ticket: 3211
version_fixed: 1.4.3

git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-4@17443 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/ChangeLog
src/lib/krb5/ccache/cc_mslsa.c

index e015116a51b375d562c7a9493a22ba7b84c2e65f..ff19622c54140651edb365d7f0f426ce5b04026c 100644 (file)
@@ -1,3 +1,10 @@
+2005-10-20  Jeffrey Altman <jaltman@mit.edu>
+
+       * cc_mslsa.c: 
+          - provide defaults for client and server names in purge 
+            ticket routines
+          - properly size the buffers used to store the names.
+
 2005-06-15  Ken Raeburn  <raeburn@mit.edu>
 
        * cc_file.c (dereference): Fix test is list-walking loop.
index fdd3f108b44e839400d9d648cbd4d732afa513f2..41fc1c198994d0420d49f830c82f685c4522b307 100644 (file)
@@ -737,7 +737,7 @@ PurgeTicket2000( HANDLE LogonHandle, ULONG  PackageId,
     NTSTATUS SubStatus = 0;
     KERB_PURGE_TKT_CACHE_REQUEST * pPurgeRequest;
     DWORD dwRequestLen = sizeof(KERB_PURGE_TKT_CACHE_REQUEST) + 1024;
-    char * sname, * srealm = NULL;
+    char * sname = NULL, * srealm = NULL;
 
     if (krb5_unparse_name(context, cred->server, &sname))
         return FALSE;
@@ -755,12 +755,12 @@ PurgeTicket2000( HANDLE LogonHandle, ULONG  PackageId,
     pPurgeRequest->LogonId.LowPart = 0;
     pPurgeRequest->LogonId.HighPart = 0;
     pPurgeRequest->ServerName.Buffer = (PWSTR)(((CHAR *)pPurgeRequest)+sizeof(KERB_PURGE_TKT_CACHE_REQUEST));
-    pPurgeRequest->ServerName.Length = strlen(sname);
+    pPurgeRequest->ServerName.Length = strlen(sname)*sizeof(WCHAR);
     pPurgeRequest->ServerName.MaximumLength = 256;
     ANSIToUnicode(sname, pPurgeRequest->ServerName.Buffer,
                   pPurgeRequest->ServerName.MaximumLength);
     pPurgeRequest->RealmName.Buffer = (PWSTR)(((CHAR *)pPurgeRequest)+sizeof(KERB_PURGE_TKT_CACHE_REQUEST)+512);
-    pPurgeRequest->RealmName.Length = strlen(srealm);
+    pPurgeRequest->RealmName.Length = strlen(srealm)*sizeof(WCHAR);
     pPurgeRequest->RealmName.MaximumLength = 256;
     ANSIToUnicode(srealm, pPurgeRequest->RealmName.Buffer,
                   pPurgeRequest->RealmName.MaximumLength);
@@ -791,8 +791,8 @@ PurgeTicketXP( HANDLE LogonHandle, ULONG  PackageId,
     NTSTATUS SubStatus = 0;
     KERB_PURGE_TKT_CACHE_EX_REQUEST * pPurgeRequest;
     DWORD dwRequestLen = sizeof(KERB_PURGE_TKT_CACHE_EX_REQUEST) + 2048;
-    char * cname, * crealm = NULL;
-    char * sname, * srealm = NULL;
+    char * cname = NULL, * crealm = NULL;
+    char * sname = NULL, * srealm = NULL;
 
     if (krb5_unparse_name(context, cred->client, &cname))
         return FALSE;
@@ -820,25 +820,25 @@ PurgeTicketXP( HANDLE LogonHandle, ULONG  PackageId,
     pPurgeRequest->LogonId.HighPart = 0;
     pPurgeRequest->Flags = 0;
     pPurgeRequest->TicketTemplate.ClientName.Buffer = (PWSTR)((CHAR *)pPurgeRequest + sizeof(KERB_PURGE_TKT_CACHE_EX_REQUEST));
-    pPurgeRequest->TicketTemplate.ClientName.Length = strlen(cname);
+    pPurgeRequest->TicketTemplate.ClientName.Length = strlen(cname)*sizeof(WCHAR);
     pPurgeRequest->TicketTemplate.ClientName.MaximumLength = 256;
     ANSIToUnicode(cname, pPurgeRequest->TicketTemplate.ClientName.Buffer,
                   pPurgeRequest->TicketTemplate.ClientName.MaximumLength);
 
     pPurgeRequest->TicketTemplate.ClientRealm.Buffer = (PWSTR)(((CHAR *)pPurgeRequest)+sizeof(KERB_PURGE_TKT_CACHE_EX_REQUEST) + 512);
-    pPurgeRequest->TicketTemplate.ClientRealm.Length = strlen(crealm);
+    pPurgeRequest->TicketTemplate.ClientRealm.Length = strlen(crealm)*sizeof(WCHAR);
     pPurgeRequest->TicketTemplate.ClientRealm.MaximumLength = 256;
     ANSIToUnicode(crealm, pPurgeRequest->TicketTemplate.ClientRealm.Buffer,
                   pPurgeRequest->TicketTemplate.ClientRealm.MaximumLength);
 
     pPurgeRequest->TicketTemplate.ServerName.Buffer = (PWSTR)(((CHAR *)pPurgeRequest)+sizeof(KERB_PURGE_TKT_CACHE_EX_REQUEST) + 1024);
-    pPurgeRequest->TicketTemplate.ServerName.Length = strlen(sname);
+    pPurgeRequest->TicketTemplate.ServerName.Length = strlen(sname)*sizeof(WCHAR);
     pPurgeRequest->TicketTemplate.ServerName.MaximumLength = 256;
     ANSIToUnicode(sname, pPurgeRequest->TicketTemplate.ServerName.Buffer,
                   pPurgeRequest->TicketTemplate.ServerName.MaximumLength);
 
     pPurgeRequest->TicketTemplate.ServerRealm.Buffer = (PWSTR)(((CHAR *)pPurgeRequest)+sizeof(KERB_PURGE_TKT_CACHE_EX_REQUEST) + 1536);
-    pPurgeRequest->TicketTemplate.ServerRealm.Length = strlen(srealm);
+    pPurgeRequest->TicketTemplate.ServerRealm.Length = strlen(srealm)*sizeof(WCHAR);
     pPurgeRequest->TicketTemplate.ServerRealm.MaximumLength = 256;
     ANSIToUnicode(srealm, pPurgeRequest->TicketTemplate.ServerRealm.Buffer,
                   pPurgeRequest->TicketTemplate.ServerRealm.MaximumLength);