* ccdefname.c: Added support to store a krb5_principal in the os_context
along with the default ccache name (if known, this principal is the same
as the last time we looked at the ccache.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12167
dc483132-0cff-0310-8789-
dd5450dbe970
return ENOMEM;
strcpy(new_name, name_buf);
+ if (!os_ctx->default_ccname || (strcmp(os_ctx->default_ccname, new_name) != 0)) {
+ /* the ccache changed... forget the old principal */
+ if (os_ctx->default_ccprincipal)
+ krb5_free_principal (context, os_ctx->default_ccprincipal);
+ os_ctx->default_ccprincipal = 0; /* we don't care until we use it */
+ }
+
if (os_ctx->default_ccname)
free(os_ctx->default_ccname);