* client_init.c (_kadm5_init_any): If creating a new ccache, put it in memory
authorKen Raeburn <raeburn@mit.edu>
Wed, 18 Sep 2002 20:40:25 +0000 (20:40 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 18 Sep 2002 20:40:25 +0000 (20:40 +0000)
instead of on disk.

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

src/lib/kadm5/clnt/ChangeLog
src/lib/kadm5/clnt/client_init.c

index 832dde115981a578fb51229368c79dd477b445a9..ebee3a1b411ce65bc710574de564d75c0a07332d 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-18  Ken Raeburn  <raeburn@mit.edu>
+
+       * client_init.c (_kadm5_init_any): If creating a new ccache, put
+       it in memory instead of on disk.
+
 2002-08-29  Ken Raeburn  <raeburn@mit.edu>
 
        * Makefile.in: Revert $(S)=>/ change, for Windows support.
index 0d99d99df66a2dadb7b430b5f9971aa93c4d102f..4e0b53fd9828b9853c0bcbb813310feabb722618 100644 (file)
@@ -322,6 +322,7 @@ static kadm5_ret_t _kadm5_init_any(char *client_name,
                  krb5_cc_get_type(handle->context, ccache),
                  krb5_cc_get_name(handle->context, ccache));
      } else {
+#if 0
          handle->cache_name =
               (char *) malloc(strlen(ADM_CCACHE)+strlen("FILE:")+1);
          if (handle->cache_name == NULL) {
@@ -330,6 +331,14 @@ static kadm5_ret_t _kadm5_init_any(char *client_name,
          }
          sprintf(handle->cache_name, "FILE:%s", ADM_CCACHE);
          mktemp(handle->cache_name + strlen("FILE:"));
+#else
+         {
+             static int counter = 0;
+             handle->cache_name = malloc(sizeof("MEMORY:kadm5_")
+                                         + 3*sizeof(counter));
+             sprintf(handle->cache_name, "MEMORY:kadm5_%u", counter++);
+         }
+#endif
      
          if ((code = krb5_cc_resolve(handle->context, handle->cache_name,
                                      &ccache)))