Bug fix: the default credentials cache was not being used if a client
name was specified. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11038 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
		@@ -263,9 +263,22 @@ get_cred_cache(krb5_context context,
 | 
				
			|||||||
	    }
 | 
						    }
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if(client == NULL)
 | 
						if (client != NULL) {
 | 
				
			||||||
 | 
						    /* A client was specified by the caller. */
 | 
				
			||||||
 | 
						    if (default_client != NULL) {
 | 
				
			||||||
 | 
							krb5_free_principal(context, default_client);
 | 
				
			||||||
 | 
							default_client = NULL;
 | 
				
			||||||
 | 
						    }
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						else if (default_client != NULL)
 | 
				
			||||||
 | 
						    /* No client was specified by the caller, but we have a
 | 
				
			||||||
 | 
						     * client from the default credentials cache.
 | 
				
			||||||
 | 
						     */
 | 
				
			||||||
	    client = default_client;
 | 
						    client = default_client;
 | 
				
			||||||
	if(client == NULL) {
 | 
						else {
 | 
				
			||||||
 | 
						    /* No client was specified by the caller and we cannot determine
 | 
				
			||||||
 | 
						     * the client from a credentials cache.
 | 
				
			||||||
 | 
						     */
 | 
				
			||||||
	    const char *user;
 | 
						    const char *user;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	    user = get_default_username ();
 | 
						    user = get_default_username ();
 | 
				
			||||||
@@ -276,10 +289,6 @@ get_cred_cache(krb5_context context,
 | 
				
			|||||||
				      NULL, user, "admin", NULL);
 | 
									      NULL, user, "admin", NULL);
 | 
				
			||||||
	    if(ret)
 | 
						    if(ret)
 | 
				
			||||||
		return ret;
 | 
							return ret;
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
	if(client != default_client) {
 | 
					 | 
				
			||||||
	    krb5_free_principal(context, default_client);
 | 
					 | 
				
			||||||
	    default_client = NULL;
 | 
					 | 
				
			||||||
	    if (id != NULL) {
 | 
						    if (id != NULL) {
 | 
				
			||||||
		krb5_cc_close(context, id);
 | 
							krb5_cc_close(context, id);
 | 
				
			||||||
		id = NULL;
 | 
							id = NULL;
 | 
				
			||||||
@@ -288,7 +297,6 @@ get_cred_cache(krb5_context context,
 | 
				
			|||||||
    } else if(ccache != NULL)
 | 
					    } else if(ccache != NULL)
 | 
				
			||||||
	id = ccache;
 | 
						id = ccache;
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					 | 
				
			||||||
    if(id && (default_client == NULL || 
 | 
					    if(id && (default_client == NULL || 
 | 
				
			||||||
	      krb5_principal_compare(context, client, default_client))) {
 | 
						      krb5_principal_compare(context, client, default_client))) {
 | 
				
			||||||
	ret = get_kadm_ticket(context, id, client, server_name);
 | 
						ret = get_kadm_ticket(context, id, client, server_name);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user