Re: [PATCH] gssd: Fix inner-loop variable reuse

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

 




On 02/29/2016 05:36 PM, Benjamin Coddington wrote:
> The var "i" is already in use iterating realmnames.
> 
> Signed-off-by: Benjamin Coddington <bcodding@xxxxxxxxxx>
> Fixes: "6597e391 gssd:  Don't assume the machine account will be in uppercase"
Committed... 

steved.

> ---
>  utils/gssd/krb5_util.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
> index 8ef8184..8dc64fe 100644
> --- a/utils/gssd/krb5_util.c
> +++ b/utils/gssd/krb5_util.c
> @@ -796,7 +796,7 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *tgtname,
>  	char **realmnames = NULL;
>  	char myhostname[NI_MAXHOST], targethostname[NI_MAXHOST];
>  	char myhostad[NI_MAXHOST+1];
> -	int i, j, retval;
> +	int i, j, k, retval;
>  	char *default_realm = NULL;
>  	char *realm;
>  	char *k5err = NULL;
> @@ -941,8 +941,8 @@ find_keytab_entry(krb5_context context, krb5_keytab kt, const char *tgtname,
>  				 * moving on to the svcname
>  				 */
>  				if (strcmp(svcnames[j],"$") == 0 && !tried_upper) {
> -					for (i = 0; myhostad[i] != '$'; ++i) {
> -						myhostad[i] = toupper(myhostad[i]);
> +					for (k = 0; myhostad[k] != '$'; ++k) {
> +						myhostad[k] = toupper(myhostad[k]);
>  					}
>  					j--;
>  					tried_upper = 1;
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux