Re: [PATCH] rpc.gssd: Only clear the retval if it has not been set

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

 




On 07/30/2015 05:15 PM, Steve Dickson wrote:
> In gssd_search_krb5_keytab() an error code can be
> cleared by blindly setting retval to zero.
> 
> Reported-by: Jianhong Yin <jiyin@xxxxxxxxxx>
> Signed-off-by: Steve Dickson <steved@xxxxxxxxxx>
Committed... 

steved.
> ---
>  utils/gssd/krb5_util.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c
> index f1ebc0d..ecf17a2 100644
> --- a/utils/gssd/krb5_util.c
> +++ b/utils/gssd/krb5_util.c
> @@ -772,7 +772,9 @@ gssd_search_krb5_keytab(krb5_context context, krb5_keytab kt,
>  			    "keytab '%s'\n", k5err, kt_name);
>  	}
>  
> -	retval = 0;
> +	/* Only clear the retval if has not been set */
> +	if (retval < 0)
> +		retval = 0;
>    out:
>  	free(k5err);
>  	return retval;
> 
--
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