[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: krb5_cc_next_cred



The MIT krb5 API tex docs have various bugs in them, including this one.

Nico


On Wed, Apr 25, 2001 at 02:53:20PM -0500, Jacques A. Vidrine wrote:
> Hello,
> 
> Attached  is   a  patch   to  reverse  the   last  two   arguments  to
> krb5_cc_next_cred.   This makes  the function  source code  compatible
> with  MIT Kerberos  5  -- and  strangely enough,  this  also makes  it
> consistent with the internal get_next operation of the ccache.
> 
> Without this change,  developers have to make  some questionable tests
> at build time to find out how to call krb5_cc_next_cred.
> 
> Cheers,
> -- 
> Jacques Vidrine / n@nectar.com / jvidrine@verio.net / nectar@FreeBSD.org
> 
> 
> 
> --- kuser/klist.c.orig	Wed Apr 25 14:40:15 2001
> +++ kuser/klist.c	Wed Apr 25 14:41:10 2001
> @@ -275,8 +275,8 @@
>      }
>      while (krb5_cc_next_cred (context,
>  			      ccache,
> -			      &creds,
> -			      &cursor) == 0) {
> +			      &cursor,
> +			      &creds) == 0) {
>  	if(do_verbose){
>  	    print_cred_verbose(context, &creds);
>  	}else{
> --- lib/krb5/cache.c.orig	Wed Apr 25 14:44:30 2001
> +++ lib/krb5/cache.c	Wed Apr 25 14:45:10 2001
> @@ -281,7 +281,7 @@
>      krb5_error_code ret;
>      krb5_cc_cursor cursor;
>      krb5_cc_start_seq_get(context, id, &cursor);
> -    while((ret = krb5_cc_next_cred(context, id, creds, &cursor)) == 0){
> +    while((ret = krb5_cc_next_cred(context, id, &cursor, creds)) == 0){
>  	if(krb5_compare_creds(context, whichfields, mcreds, creds)){
>  	    ret = 0;
>  	    break;
> @@ -328,8 +328,8 @@
>  krb5_error_code
>  krb5_cc_next_cred (krb5_context context,
>  		   const krb5_ccache id,
> -		   krb5_creds *creds,
> -		   krb5_cc_cursor *cursor)
> +		   krb5_cc_cursor *cursor,
> +		   krb5_creds *creds)
>  {
>      return id->ops->get_next(context, id, cursor, creds);
>  }
> @@ -400,7 +400,7 @@
>  	krb5_free_principal(context, princ);
>  	return ret;
>      }
> -    while(ret == 0 && krb5_cc_next_cred(context, from, &cred, &cursor) == 0){
> +    while(ret == 0 && krb5_cc_next_cred(context, from, &cursor, &cred) == 0){
>  	ret = krb5_cc_store_cred(context, to, &cred);
>  	krb5_free_creds_contents (context, &cred);
>      }
> --- lib/krb5/krb5-protos.h.orig	Wed Apr 25 14:46:47 2001
> +++ lib/krb5/krb5-protos.h	Wed Apr 25 14:47:02 2001
> @@ -453,8 +453,8 @@
>  krb5_cc_next_cred __P((
>  	krb5_context context,
>  	const krb5_ccache id,
> -	krb5_creds *creds,
> -	krb5_cc_cursor *cursor));
> +	krb5_cc_cursor *cursor,
> +	krb5_creds *creds));
>  
>  krb5_error_code
>  krb5_cc_register __P((
--