Windows: KFW_AFS should use API: ccache
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 3 Nov 2011 20:39:18 +0000 (16:39 -0400)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 4 Nov 2011 22:38:38 +0000 (15:38 -0700)
During the Heimdal transition that default ccache type
was changed to FILE.  Restore the use of API: ccaches.

Change-Id: Idd8dfb46fc9167d8c1eb44466b76906a152eef9d
Reviewed-on: http://gerrit.openafs.org/5802
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>

src/WINNT/afsd/afskfw.c

index d6017f3..1a93711 100644 (file)
@@ -679,32 +679,23 @@ get_default_ccache_name_for_principal(krb5_context context, krb5_principal princ
                                       char ** cc_name)
 {
     char * pname = NULL;
-    char * epname = NULL;
     krb5_error_code code;
     size_t len = 0;
-    char temppath[MAX_PATH]="";
 
     *cc_name = NULL;
 
     code = krb5_unparse_name(context, principal, &pname);
     if (code) goto cleanup;
 
-    escape_unsafe_principal_characters(pname, &epname);
-
-    len = strlen(epname);
-    len += 21;
+    len = strlen(pname) + 5;
     *cc_name = (char *) malloc(len);
 
-    GetTempPathA(MAX_PATH, temppath);
-    StringCbPrintfA(*cc_name, len, "FILE:%skrb5cc_%s", temppath, epname);
+    StringCbPrintfA(*cc_name, len, "API:%s", pname, GetCurrentThreadId());
 
 cleanup:
     if (pname)
         krb5_free_unparsed_name(context, pname);
 
-    if (epname)
-        free(epname);
-
     return;
 }