2000-4-13 Alexandra Ellwood <lxs@mit.edu>
authorAlexandra Ellwood <lxs@mit.edu>
Thu, 13 Apr 2000 22:05:57 +0000 (22:05 +0000)
committerAlexandra Ellwood <lxs@mit.edu>
Thu, 13 Apr 2000 22:05:57 +0000 (22:05 +0000)
* 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

src/lib/krb5/os/ccdefname.c

index 53e788859113e1c68ff8ee949e1b40250db53e3f..3bc2546cbb910018e64ba4f5e297d3d5d6d5a7c4 100644 (file)
@@ -261,6 +261,13 @@ krb5_cc_set_default_name(context, name)
                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);