From: Ken Raeburn Date: Wed, 18 Sep 2002 20:40:25 +0000 (+0000) Subject: * client_init.c (_kadm5_init_any): If creating a new ccache, put it in memory X-Git-Tag: krb5-1.3-alpha1~375 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=aaafb44ace5e6988c76f29478b827f43b23fa7ba;p=krb5.git * client_init.c (_kadm5_init_any): If creating a new ccache, put it in memory instead of on disk. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14876 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kadm5/clnt/ChangeLog b/src/lib/kadm5/clnt/ChangeLog index 832dde115..ebee3a1b4 100644 --- a/src/lib/kadm5/clnt/ChangeLog +++ b/src/lib/kadm5/clnt/ChangeLog @@ -1,3 +1,8 @@ +2002-09-18 Ken Raeburn + + * client_init.c (_kadm5_init_any): If creating a new ccache, put + it in memory instead of on disk. + 2002-08-29 Ken Raeburn * Makefile.in: Revert $(S)=>/ change, for Windows support. diff --git a/src/lib/kadm5/clnt/client_init.c b/src/lib/kadm5/clnt/client_init.c index 0d99d99df..4e0b53fd9 100644 --- a/src/lib/kadm5/clnt/client_init.c +++ b/src/lib/kadm5/clnt/client_init.c @@ -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)))